-
Notifications
You must be signed in to change notification settings - Fork 19
56 lines (46 loc) · 1.33 KB
/
prepare-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
50
51
52
53
54
55
56
name: Prepare release
on:
workflow_dispatch:
inputs:
version:
description: Version to release (e.g. v1.2.3)
required: false
default: 'auto'
type: string
permissions:
contents: write
pull-requests: write
jobs:
generate-pr:
runs-on: ubuntu-latest
name: Generate release PR
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Batch changes
uses: miniscruff/changie-action@v2
with:
args: batch ${{ inputs.version }}
- name: Merge changes
uses: miniscruff/changie-action@v2
with:
args: merge
- name: Get the latest version
id: latest
uses: miniscruff/changie-action@v2
with:
args: latest
- name: Update unreleased references in docs
run: |
grep -rlF '<!-- gs:version unreleased -->' doc/src |
xargs perl -p -i -e \
's/<!-- gs:version unreleased -->/<!-- gs:version ${{ steps.latest.outputs.output }} -->/g'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: Release ${{ steps.latest.outputs.output }}
branch: release/${{ steps.latest.outputs.output }}
labels: prepare-release
commit-message: Release ${{ steps.latest.outputs.output }}
token: ${{ secrets.PAT }}
body: ''