Publish release to GitHub #13
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: Publish release to GitHub | |
on: | |
workflow_run: | |
workflows: ["Version bump"] | |
branches: [master] | |
types: | |
- completed | |
jobs: | |
version-bump: | |
name: Release to github releases | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set env | |
run: echo "pkg_version=$(awk '/version/{gsub(/("|",)/,"",$2);print $2}' package.json)" >> $GITHUB_ENV | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.pkg_version }} | |
release_name: ${{ env.pkg_version }} | |
body: | | |
- | |
draft: true | |
prerelease: false | |
- name: Update v1 release with the latest code | |
run: | | |
git config user.name gkr-bot | |
git config user.email [email protected] | |
git tag -fa v1 -m "Updated v1 tag with the latest code" | |
git push origin v1 --force |