Skip to content

Release

Release #313

Workflow file for this run

name: Release
on:
workflow_run:
workflows: [CI]
types: [completed]
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 2
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Validate version
id: version
env:
tag: ${{ github.event.workflow_run.head_branch }}
run: |
set -x
if echo "$tag" | grep -Pq '^v\d+\.\d+\.\d+(-.+)?'; then
echo valid=true >> "$GITHUB_OUTPUT"
echo version="$(echo "$tag" | sed 's/^v//')" >> "$GITHUB_OUTPUT"
fi
- name: Create release
if: steps.version.outputs.valid
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.workflow_run.head_branch }}
version: ${{ steps.version.outputs.version }}
run: |
sed -n "/^## \[${version}\]/,/^## \[/{/^## \[${version}\]/d;/^## \[/d;p;}" changelog.md \
| gh release create \
"$tag" \
--title "Cross Platform Action ${version}" \
--draft \
--notes-file -