-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (54 loc) · 1.76 KB
/
Copy pathpreview-release.yml
File metadata and controls
68 lines (54 loc) · 1.76 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
64
65
66
67
name: preview-release
on:
workflow_dispatch:
inputs:
release_kind:
description: "Release line to preview."
required: true
default: stable
type: choice
options:
- stable
- rc
permissions:
contents: read
jobs:
preview:
runs-on: ubuntu-latest
env:
RELEASE_KIND: ${{ inputs.release_kind }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: ${{ github.event.repository.default_branch }}
fetch-depth: 100
fetch-tags: true
- name: Install git-cliff
uses: taiki-e/install-action@git-cliff
- name: Compute release tag
id: compute_release_version
shell: bash
run: |
set -euo pipefail
next_tag="$(python3 .github/scripts/compute_release_version.py --release-kind "${RELEASE_KIND}")"
echo "next_tag=${next_tag}" >> "$GITHUB_OUTPUT"
- name: Generate release preview
shell: bash
env:
NEXT_TAG: ${{ steps.compute_release_version.outputs.next_tag }}
run: |
set -euo pipefail
ignore_rc_tags='^v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$'
notes_path="${RUNNER_TEMP}/release-notes.md"
if [[ "${RELEASE_KIND}" == "stable" ]]; then
git-cliff --ignore-tags "${ignore_rc_tags}" --unreleased --bump --tag "${NEXT_TAG}" --output "${notes_path}"
else
git-cliff --unreleased --bump --tag "${NEXT_TAG}" --output "${notes_path}"
fi
cat >> "$GITHUB_STEP_SUMMARY" <<EOF
# Release Preview
- Release kind: \`${RELEASE_KIND}\`
- Next tag: \`${NEXT_TAG}\`
EOF
cat "$notes_path" >> "$GITHUB_STEP_SUMMARY"