GitHub Actions: Deprecating set-output commands #49
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 to main | |
on: | |
push: | |
branches: [ main, master ] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Compute tag name | |
id: compute-tag | |
run: | | |
echo Computing next tag number | |
LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3) | |
PATCH=$(($LASTPATCH+1)) | |
echo "tagname=2.1.${PATCH}" >> $GITHUB_OUTPUT | |
echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Build release assets | |
run: bundle exec rake book:build | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.compute-tag.outputs.tagname }} | |
commit: ${{ steps.compute-tag.outputs.branch }} | |
artifacts: './progit.epub,./progit.fb2.zip,./progit.mobi,./progit.pdf,./progit.html' |