Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Creates a new bugfix release whenever a push is made to master.

name: release

# Controls when the action will run.
on:
push:
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Calculate next version
run: |
git pull
export CURRENT_VERSION=$(cat version.txt)
export THIS_VERSION=$(echo $CURRENT_VERSION | awk -F. -v OFS=. '{$NF++;print}')
echo "THIS_VERSION=$THIS_VERSION" >> $GITHUB_ENV

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I'm aware of.
Is there an advantage to using the actions output syntax over the actions env syntax?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea! :) Either way looks like it works


- name: Store next version
run: |
echo ${{ env.THIS_VERSION }} > version.txt

git config user.name "GitHub Actions"
git config user.email "actions@users.noreply.github.com"
git commit -am "Automated release - advance the release version."
git push

- name: Cut release
uses: softprops/action-gh-release@91409e712cf565ce9eff10c87a8d1b11b81757ae
with:
tag_name: v${{ env.THIS_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}