-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.61 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (54 loc) · 1.61 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
54
55
56
57
58
59
60
61
62
63
name: Create Release
on:
push:
tags:
- "v*.*.*"
repository_dispatch:
types: [new-tag-created]
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --only-group dev
- name: Determine tag
id: tag
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "name=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
else
echo "name=${{ github.event.client_payload.tag }}" >> "$GITHUB_OUTPUT"
fi
- name: Get changelog for this version
id: changelog
run: |
TAG="${{ steps.tag.outputs.name }}"
echo "version=$TAG" >> "$GITHUB_ENV"
echo "body<<EOF" >> "$GITHUB_ENV"
# Extract changelog for this version from CHANGELOG.md
if [ -f CHANGELOG.md ]; then
BODY=$(uv run git-cliff --tag "$TAG" --strip all | tail -n +2 || true)
else
BODY=""
fi
echo "$BODY" >> "$GITHUB_ENV"
echo "EOF" >> "$GITHUB_ENV"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.name }}
name: ${{ env.version }}
body: ${{ env.body }}
draft: false
prerelease: false
make_latest: true