Skip to content

Commit

Permalink
build: remove Version step from release workflow (#7032)
Browse files Browse the repository at this point in the history
* build: remove `Version` step from release workflow

the `version` step was added so that the build
could be ran with updated package.json version
but this was cause an issue when installing after
the version bump. it's not strictly necessary so
we'll be removing this as a result

* fix: define PKG_VERSION from workflow input
  • Loading branch information
ricokahler committed Jun 27, 2024
1 parent b06d143 commit 5006d7f
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 5006d7f

Please sign in to comment.