-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (101 loc) · 3.54 KB
/
release-pr.yaml
File metadata and controls
107 lines (101 loc) · 3.54 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# This file is @generated by <https://github.com/liblaf/copier-release>.
# DO NOT EDIT!
name: Release / PR
on:
push:
branches:
- main
env:
GIT_CLIFF_CONFIG_URL: https://raw.githubusercontent.com/liblaf/copier-release/refs/heads/main/cliff.toml
concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true
jobs:
version:
name: Version
if: >-
${{ !startsWith(github.event.head_commit.message, 'chore(release): ') }}
runs-on: ubuntu-latest
outputs:
bumped: ${{ steps.version.outputs.bumped }}
release-as: ${{ steps.version.outputs.release-as }}
tag: ${{ steps.version.outputs.tag }}
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Install git-cliff
uses: taiki-e/install-action@7a562dfa955aa2e4d5b0fd6ebd57ff9715c07b0b # v2
with:
tool: git-cliff
- id: version
name: Next version
uses: liblaf/actions/next-version@12ffbdf8f37ab1ff07565b44b643fd8433621cd7 # v1
env:
GIT_CLIFF_CONFIG_URL: ${{ env.GIT_CLIFF_CONFIG_URL }}
GITHUB_TOKEN: ${{ github.token }}
release-pr:
name: Create PR
permissions:
contents: write
issues: write
pull-requests: write
needs:
- version
if: needs.version.outputs.bumped == 'true'
runs-on: ubuntu-latest
environment:
name: release-please
deployment: false
steps:
- id: auth
name: Auth
uses: liblaf/actions/auth@12ffbdf8f37ab1ff07565b44b643fd8433621cd7 # v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Install git-cliff
uses: taiki-e/install-action@7a562dfa955aa2e4d5b0fd6ebd57ff9715c07b0b # v2
with:
tool: git-cliff
- name: Generate changelog
run: |-
git-cliff
npx prettier --write --no-config "$GIT_CLIFF_OUTPUT"
env:
GIT_CLIFF_CONFIG_URL: ${{ env.GIT_CLIFF_CONFIG_URL }}
GIT_CLIFF_OUTPUT: CHANGELOG.md
GIT_CLIFF_TAG: ${{ needs.version.outputs.tag }}
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}
- name: Generate PR body
run: |-
git-cliff --unreleased --strip all
npx prettier --write --no-config "$GIT_CLIFF_OUTPUT"
env:
GIT_CLIFF_CONFIG_URL: ${{ env.GIT_CLIFF_CONFIG_URL }}
GIT_CLIFF_OUTPUT: ${{ runner.temp }}/body.md
GIT_CLIFF_TAG: ${{ needs.version.outputs.tag }}
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}
- if: hashFiles('package.json')
name: Bump package.json
run: npm version '${{ needs.version.outputs.version }}' --no-git-tag-version
- name: Create PR
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
with:
token: ${{ steps.auth.outputs.token }}
commit-message: "chore(release): ${{ needs.version.outputs.tag }}"
branch: release-please/${{ github.ref_name }}
delete-branch: true
sign-commits: true
title: "chore(release): ${{ needs.version.outputs.tag }}"
body-path: ${{ runner.temp }}/body.md
labels: |-
automerge
release-please
assignees: ${{ github.repository_owner }}