Skip to content

release

release #12

Workflow file for this run

name: release
on:
workflow_run:
workflows:
- check
types:
- completed
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' && github.ref_name == 'master' && startsWith(github.event.workflow_run.head_branch, 'v')
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_branch }}
- name: Determine if version is prerelease
id: prerelease
run: |
_prerelease=
if printf "%s\n" "${{ github.event.workflow_run.head_branch }}" | grep -q -P '^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$'; then
_prerelease=false
else
_prerelease=true
fi
printf 'value=%s\n' "$_prerelease" >> "$GITHUB_OUTPUT"
# TODO(carlocorradini) Changelog
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.workflow_run.head_branch }}
prerelease: ${{ steps.prerelease.outputs.value == 'true' }}