Skip to content

Commit

Permalink
Set version in package-solution.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvand committed Jan 22, 2025
1 parent abe0128 commit fded425
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/build-spfx-solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Run npm ci
run: npm ci

- name: Extract version number from git tag name
if: startsWith(github.ref, 'refs/tags/spfx-v')
env:
TAG: ${{ github.ref_name }}
id: splittag
run: echo "spfxversion=`echo $TAG | grep -oP '(?<=spfx-v)[\d+?\.]*'`" >> $GITHUB_OUTPUT

- name: Set version in package-solution.json
if: startsWith(github.ref, 'refs/tags/spfx-v')
run: jq --arg version "${{ steps.splittag.outputs.spfxversion }}" '.solution.version = $version' config/package-solution.json > tmp.json && mv tmp.json config/package-solution.json

- name: Bundle & Package
run: |
Expand All @@ -39,13 +51,6 @@ jobs:
name: 'SPFx package'
path: '${{ env.WORKING_DIRECTORY }}/sharepoint/solution/*.sppkg'

- name: Extract version number from git tag name
if: startsWith(github.ref, 'refs/tags/spfx-v')
env:
TAG: ${{ github.ref_name }}
id: splittag
run: echo "spfxversion=`echo $TAG | grep -oP '(?<=spfx-v)[\d+?\.]*'`" >> $GITHUB_OUTPUT

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/spfx-v')
Expand Down

0 comments on commit fded425

Please sign in to comment.