diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 405fe25..48af6da 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,11 +20,14 @@ jobs: registry-url: 'https://registry.npmjs.org/' - name: Install dependencies run: yarn install --frozen-lockfile --ignore-engines - - name: Build the plugin - run: yarn build - name: Get the release tag version id: get_version run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + # Before the build: the CLI bundles package.json, and reports its version. + - name: Set package version + run: yarn version --new-version "${{ steps.get_version.outputs.VERSION }}" --no-git-tag-version + - name: Build the plugin + run: yarn build - name: Extract pre-release tag if any id: extract_tag run: | @@ -44,8 +47,6 @@ jobs: RELEASE_COMMIT=$(git rev-list -n 1 ${{ steps.get_version.outputs.VERSION }}) SOURCE_BRANCH=$(git branch -r --contains $RELEASE_COMMIT | grep -v HEAD | head -n 1 | sed 's/.*origin\///') echo "SOURCE_BRANCH=$SOURCE_BRANCH" >> $GITHUB_OUTPUT - - name: Set package version - run: yarn version --new-version "${{ steps.get_version.outputs.VERSION }}" --no-git-tag-version - name: Publish package run: npm publish --provenance --access public --tag ${{ steps.extract_tag.outputs.NPM_TAG }} - name: Push version bump