-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 2.11 KB
/
release.yml
File metadata and controls
66 lines (58 loc) · 2.11 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
name: Release
on:
workflow_dispatch:
inputs:
bump:
description: "Version bump type (leave empty to auto-detect from commits)"
required: false
type: choice
options:
- ""
- patch
- minor
- major
permissions:
contents: write
jobs:
test:
uses: ./.github/workflows/test.yml
release:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install git-cliff
uses: taiki-e/install-action@git-cliff
- name: Determine next version
id: version
run: |
BUMP_ARG="${{ inputs.bump && format('--bump {0}', inputs.bump) || '--bump' }}"
VERSION=$(git-cliff --bumped-version $BUMP_ARG)
if [ -z "$VERSION" ]; then
echo "::error::No version bump detected. Are there any conventional commits since the last tag?"
exit 1
fi
echo "Next version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Generate changelog
id: changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --unreleased --strip header --tag ${{ steps.version.outputs.version }}
env:
OUTPUT: CHANGES.md
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
body_path: CHANGES.md
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true