-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (42 loc) · 1.34 KB
/
Copy pathdraft-release.yml
File metadata and controls
47 lines (42 loc) · 1.34 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
name: draft-release
on:
push:
tags:
- 'base-v*'
- 'core-v*'
- 'gen-v*'
jobs:
draft-github-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Get version from tag
id: get-version
run: |
TAG="${GITHUB_REF_NAME}"
PACKAGE="${TAG%%-v*}"
VERSION="${TAG#${PACKAGE}-v}"
echo "package=${PACKAGE}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Extract changelog
id: get-changelog
run: |
CHANGELOG=$(python3 .github/scripts/extract_changelog.py "${{ steps.get-version.outputs.package }}" "${{ steps.get-version.outputs.version }}")
echo "changelog<<EOF" >> "$GITHUB_OUTPUT"
echo "$CHANGELOG" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Create Draft Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGELOG: ${{ steps.get-changelog.outputs.changelog }}
run: |
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--verify-tag \
--notes "$CHANGELOG" \
--draft