-
-
Notifications
You must be signed in to change notification settings - Fork 246
49 lines (45 loc) · 1.57 KB
/
generate_release.yml
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
on:
workflow_call:
workflow_dispatch:
inputs:
handwritten:
description: 'Small changelog about changes in this build:'
target:
description: 'Release Branch (e.g., testing). Defaults to branch name.'
permissions:
contents: write
name: Generate Release
jobs:
generate-release:
runs-on: ubuntu-latest
steps:
- name: Checkout last 500 commits (for <commits> to work)
uses: actions/checkout@v4
with:
fetch-depth: 500
- name: Get target
id: get-target
run: |
TARGET="${{ github.event.inputs.target || github.ref }}"
TARGET="${TARGET##*/}"
if [ "$TARGET" = "main" ]; then
TARGET="stable"
fi
echo "target=$TARGET" >> $GITHUB_OUTPUT
- name: Generate Release Text
id: generate-release
run: |
python3 ./.github/workflows/changelog.py \
"${{ steps.get-target.outputs.target }}" \
./output.env ./changelog.md --workdir . --handwritten "${{ github.event.inputs.handwritten }}"
source ./output.env
echo "title=${TITLE}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.generate-release.outputs.title }}
tag_name: ${{ steps.generate-release.outputs.tag }}
body_path: ./changelog.md
make_latest: ${{ steps.get-target.outputs.target == 'stable' }}
prerelease: ${{ steps.get-target.outputs.target != 'stable' }}