-
Notifications
You must be signed in to change notification settings - Fork 10
53 lines (47 loc) · 1.32 KB
/
Copy pathgithub_release.yml
File metadata and controls
53 lines (47 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: GitHub Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Existing tag to publish (e.g. v1.1.1)"
required: true
type: string
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Resolve tag name
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "name=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "name=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
fi
- name: Build release notes from CHANGELOG
id: notes
run: |
BODY_FILE="$(mktemp)"
python scripts/extract_changelog.py "${{ steps.tag.outputs.name }}" > "$BODY_FILE"
{
echo "body<<CHANGELOG_EOF"
cat "$BODY_FILE"
echo "CHANGELOG_EOF"
} >> "$GITHUB_OUTPUT"
- name: Create or update GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.tag.outputs.name }}
name: ${{ steps.tag.outputs.name }}
body: ${{ steps.notes.outputs.body }}
generate_release_notes: false
make_latest: true