diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f9953d2f4d..18bf1bc100c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,7 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true + PKG_VERSION: ${{ inputs.version }} runs-on: ubuntu-latest steps: - name: Checkout @@ -59,6 +60,10 @@ jobs: - name: Pre-flight run: | + # Check if the incoming version exactly matches the format xx.xx.xx e.g. no `v` prefix + [[ "$PKG_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \ + || { echo "PKG_VERSION must be an explicit semver version with no `v` prefix"; exit 1; } + # Check incoming version is at or above the currently published version on NPM # Note: we allow the current version in the even that a publish partially fails npx semver ${{ inputs.version }} -r ">=$(npm show sanity version) 3.x" @@ -92,17 +97,6 @@ jobs: git checkout current git rebase ${{ github.ref }} - - name: Version - run: | - # Just bump the versions first, no push yet - lerna version \ - --no-git-tag-version \ - --no-push \ - --force-publish \ - --exact \ - --yes \ - ${{ inputs.version }} - - name: Build run: pnpm build --output-logs=full --log-order=grouped