Debian Codegraph @

.github/workflows/release.yaml

raw
1 name: Release
2
3 on:
4 push:
5 tags:
6 - 'v*'
7
8 permissions:
9 contents: write
10
11 concurrency:
12 group: release-${{ github.ref }}
13 cancel-in-progress: false
14
15 jobs:
16 release:
17 name: Create release
18 runs-on: ubuntu-latest
19 steps:
20 - name: Create release with generated notes
21 env:
22 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 run: |
24 set -euo pipefail
25 if output=$(gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" 2>&1); then
26 echo "Release $GITHUB_REF_NAME already exists, skipping"
27 exit 0
28 elif ! grep -qi "release not found" <<< "$output"; then
29 # A lookup failure other than "not found" (auth, network, API)
30 # must not fall through to the create step.
31 echo "$output" >&2
32 exit 1
33 fi
34 gh release create "$GITHUB_REF_NAME" \
35 --repo "$GITHUB_REPOSITORY" \
36 --title "${GITHUB_REF_NAME#v}" \
37 --verify-tag \
38 --generate-notes