Skip to content

Commit

Permalink
ci: fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
Mararok committed Mar 7, 2024
1 parent 514cc85 commit 88e9b92
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,40 @@ jobs:
- name: test
uses: ./.github/actions/test

- name: publish
uses: ./.github/actions/publish
# Bump version
- name: Bump package version
shell: bash
run: |
yarn version $RELEASE_TYPE
echo "RELEASE_TAG=latest" >> $GITHUB_ENV
echo "NEW_VERSION=$(jq -r '.version' < package.json)" >> $GITHUB_ENV
env:
RELEASE_TYPE: ${{ inputs.releaseType }}

- name: Update CHANGELOG.md
uses: 'zen8sol/[email protected]'
with:
newVersion: '${{ env.NEW_VERSION }}'

# Publish package
- name: Publish
shell: bash
run: |
echo -e "\nnpmAuthToken: '${{ env.NODE_AUTH_TOKEN }}'" >> ./.yarnrc.yml
yarn npm publish --access public --tag ${{ env.RELEASE_TAG }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Commit
- name: Commit CHANGELOG.md and package.json changes and create tag
shell: bash
run: |
git config --global user.email "[email protected]"
git config --global user.name "Hexancore Bot"
git add "package.json"
git add "CHANGELOG.md"
git commit -m "chore: release ${{ env.NEW_VERSION }}"
git tag -m 'new version' ${{ env.NEW_VERSION }}
git push --follow-tags
#- name: publish
# uses: ./.github/actions/publish

0 comments on commit 88e9b92

Please sign in to comment.