Updating version #3
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: Create release and pre-release on VERSION change | |
on: | |
push: | |
branches: | |
- main | |
- release | |
paths: | |
- 'VERSION' | |
jobs: | |
create-release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Get version | |
id: get-version | |
run: | | |
VERSION_CONTENT=$(cat VERSION) | |
echo "::set-output name=version::$VERSION_CONTENT" | |
if [[ $VERSION_CONTENT == *"-alpha"* ]]; then | |
echo "::set-output name=prerelease::true" | |
else | |
echo "::set-output name=prerelease::false" | |
fi | |
- name: Create release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get-version.outputs.version }} | |
release_name: Release ${{ steps.get-version.outputs.version }} | |
draft: false | |
prerelease: ${{ steps.get-version.outputs.prerelease }} |