Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Hellemans <nick@awellhealth.com>
  • Loading branch information
nckhell authored Jan 2, 2025
1 parent 94a8418 commit 35f4da6
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,6 @@ jobs:
- name: Compile Typescript
run: yarn build

- name: Update package.json version
run: |
release_version=${GITHUB_REF_NAME#v}
jq ".version = \"$release_version\"" package.json > package.json.tmp
mv package.json.tmp package.json
- name: Commit updated package.json
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add package.json
git commit -m "chore: sync version with release $release_version"
git push
- name: Validate release version
run: |
release_version=${GITHUB_REF_NAME#v}
current_version=$(jq -r '.version' package.json)
if [ "$release_version" != "$current_version" ]; then
echo "Version mismatch: release tag ($release_version) does not match package.json ($current_version)."
exit 1
fi
- name: Setup .yarnrc.yml
run: |
yarn config set npmAlwaysAuth true
Expand All @@ -61,4 +38,7 @@ jobs:
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Publish to NPM Registry
run: yarn npm publish --access public
run: |
release_version=${GITHUB_REF##*/}
yarn version --new-version "$release_version"
yarn npm publish --access public

0 comments on commit 35f4da6

Please sign in to comment.