Skip to content

Instantly share code, notes, and snippets.

@kenyipp
Last active December 9, 2023 23:13
Show Gist options
  • Save kenyipp/b262ded955b1f626ab659e17df4e9af9 to your computer and use it in GitHub Desktop.
Save kenyipp/b262ded955b1f626ab659e17df4e9af9 to your computer and use it in GitHub Desktop.
Automated GitHub Release Workflow
name: Create Release
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
VERSION=$(node -pe "require('./package.json').version")
git tag -a $VERSION -m "Release $VERSION"
git push origin $VERSION
echo "version=$VERSION" >> $GITHUB_ENV
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
release_name: Release ${{ env.version }}
body: |
Changes in this release:
- Add your release notes here
draft: false
prerelease: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment