Skip to content

Commit c8722ee

Browse files
committed
feat: add initial configuration files for release automation
1 parent 1801b8a commit c8722ee

4 files changed

Lines changed: 203 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file is @generated by <https://github.com/liblaf/copier-release>.
2+
# DO NOT EDIT!
3+
# prettier-ignore
4+
_commit: v0.1.1
5+
_src_path: gh:liblaf/copier-release
6+
release_type: simple
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.config/release-please/config.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "https://github.com/googleapis/release-please/raw/refs/heads/main/schemas/config.json",
3+
"release-type": "simple",
4+
"bump-minor-pre-major": true,
5+
"bump-patch-for-minor-pre-major": true,
6+
"changelog-sections": [
7+
{
8+
"type": "feat",
9+
"section": "✨ Features"
10+
},
11+
{
12+
"type": "fix",
13+
"section": "🐛 Bug Fixes"
14+
},
15+
{
16+
"type": "docs",
17+
"section": "📝 Documentation"
18+
},
19+
{
20+
"type": "style",
21+
"section": "💄 Styles"
22+
},
23+
{
24+
"type": "refactor",
25+
"section": "♻️ Code Refactoring"
26+
},
27+
{
28+
"type": "perf",
29+
"section": "⚡️ Performance Improvements"
30+
},
31+
{
32+
"type": "test",
33+
"section": "✅ Tests"
34+
},
35+
{
36+
"type": "build",
37+
"section": "🛠 Builds"
38+
},
39+
{
40+
"type": "ci",
41+
"section": "⚙️ Continuous Integration"
42+
},
43+
{
44+
"type": "chore",
45+
"section": "🎫 Chores",
46+
"hidden": true
47+
},
48+
{
49+
"type": "revert",
50+
"section": "⏪️ Reverts"
51+
}
52+
],
53+
"include-component-in-tag": false,
54+
"always-update": true,
55+
"initial-version": "0.1.0",
56+
"packages": {
57+
".": {}
58+
}
59+
}
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# This file is @generated by <https://github.com/liblaf/copier-release>.
2+
# DO NOT EDIT!
3+
4+
name: Release Please
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
env:
12+
FORCE_COLOR: 1
13+
14+
jobs:
15+
release-please:
16+
name: Release Please
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
runs-on: ubuntu-latest
21+
environment:
22+
name: Release Please
23+
outputs:
24+
pr: ${{ steps.release-please.outputs.pr }}
25+
prs_created: ${{ steps.release-please.outputs.prs_created }}
26+
release_created: ${{ steps.release-please.outputs.release_created }}
27+
tag: ${{ steps.release-please.outputs.tag_name }}
28+
steps:
29+
- id: auth
30+
name: Auth
31+
uses: liblaf/actions/auth@v1
32+
with:
33+
app-id: ${{ vars.APP_ID }}
34+
private-key: ${{ secrets.PRIVATE_KEY }}
35+
- name: Checkout
36+
uses: actions/checkout@v5
37+
with:
38+
token: ${{ steps.auth.outputs.token }}
39+
- id: release-please
40+
name: Release Please
41+
uses: googleapis/release-please-action@v4
42+
with:
43+
token: ${{ steps.auth.outputs.token }}
44+
config-file: .config/release-please/config.json
45+
manifest-file: .config/release-please/.manifest.json
46+
47+
post-pr:
48+
name: Post PR
49+
permissions:
50+
contents: write
51+
pull-requests: write
52+
needs:
53+
- release-please
54+
if: ${{ needs.release-please.outputs.pr }}
55+
runs-on: ubuntu-latest
56+
environment:
57+
name: Release Please
58+
steps:
59+
- id: auth
60+
name: Auth
61+
uses: liblaf/actions/auth@v1
62+
with:
63+
app-id: ${{ vars.APP_ID }}
64+
private-key: ${{ secrets.PRIVATE_KEY }}
65+
- name: Checkout
66+
uses: actions/checkout@v5
67+
with:
68+
ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }}
69+
token: ${{ steps.auth.outputs.token }}
70+
fetch-depth: 0
71+
- id: tag
72+
name: Get Tag
73+
run: |-
74+
title='${{ fromJson(needs.release-please.outputs.pr).title }}'
75+
version="$(awk '{ print $NF }' <<< "$title")"
76+
printf 'tag=%s\n' "v$version" >> "$GITHUB_OUTPUT"
77+
- name: Changelog
78+
uses: liblaf/actions/changelog@v1
79+
with:
80+
output: CHANGELOG.md
81+
args: --tag '${{ steps.tag.outputs.tag }}'
82+
- id: message
83+
name: Get Commit Message
84+
run: |-
85+
delimiter="$(uuidgen)"
86+
message="$(git show --format='%B' --no-patch)"
87+
printf 'message<<%s\n%s\n%s\n' "$delimiter" "$message" "$delimiter" >> "$GITHUB_OUTPUT"
88+
- name: Undo Last Commit
89+
run: git reset --soft HEAD~1
90+
- name: Commit
91+
uses: liblaf/actions/commit@v1
92+
with:
93+
add-options: --verbose 'CHANGELOG.md'
94+
force: true
95+
message: ${{ steps.message.outputs.message }}
96+
ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }}
97+
token: ${{ steps.auth.outputs.token }}
98+
- name: Add Label
99+
run: |-
100+
gh pr edit '${{ fromJson(needs.release-please.outputs.pr).number }}' --add-label 'automerge'
101+
env:
102+
GH_TOKEN: ${{ steps.auth.outputs.token }}
103+
104+
post-release:
105+
name: Post Release
106+
permissions:
107+
contents: write
108+
needs:
109+
- release-please
110+
if: ${{ needs.release-please.outputs.release_created }}
111+
runs-on: ubuntu-latest
112+
environment:
113+
name: Release Please
114+
steps:
115+
- id: auth
116+
name: Auth
117+
uses: liblaf/actions/auth@v1
118+
with:
119+
app-id: ${{ vars.APP_ID }}
120+
private-key: ${{ secrets.PRIVATE_KEY }}
121+
- name: Checkout
122+
uses: actions/checkout@v5
123+
with:
124+
ref: ${{ needs.release-please.outputs.tag }}
125+
token: ${{ steps.auth.outputs.token }}
126+
fetch-depth: 0
127+
- id: changelog
128+
name: Changelog
129+
uses: liblaf/actions/changelog@v1
130+
with:
131+
args: --current --strip all
132+
- name: Update Release Notes
133+
run: >-
134+
gh release edit '${{ needs.release-please.outputs.tag }}'
135+
--notes-file '${{ steps.changelog.outputs.changelog }}'
136+
env:
137+
GH_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)