Merge pull request #9 from nature-heart-software/dev #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create changelog for release | |
id: github_release | |
uses: mikepenz/release-changelog-builder-action@v4 | |
with: | |
configuration: 'changelog.config.json' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
body: ${{ steps.github_release.outputs.changelog }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha')}} | |
deploy: | |
needs: [ release ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set env variables | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Version | |
run: npx lerna version $RELEASE_VERSION --yes --no-private --force-publish --no-git-tag-version | |
- name: Publish CLI | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
access: public | |
package: packages/cli | |
- name: Publish React | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
access: public | |
package: packages/react | |
- name: Rollback Release | |
if: failure() | |
uses: author/action-rollback@stable | |
with: | |
tag: ${{ env.RELEASE_VERSION }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |