Skip to content

Commit c3d07d6

Browse files
committed
chore: setup release-please action
1 parent ed1cab0 commit c3d07d6

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.github/workflows/release-please.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
- 'releases/**'
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
name: release-please
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
id: release
19+
with:
20+
# this assumes that you have created a personal access token
21+
# (PAT) and configured it as a GitHub action secret named
22+
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
23+
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
24+
release-type: python
25+
# The short ref name of the branch or tag that triggered
26+
# the workflow run. For example, `main` or `1.x`
27+
target-branch: ${{ github.ref_name }}
28+
29+
- uses: actions/checkout@v4
30+
- name: tag major and minor versions
31+
if: ${{ steps.release.outputs.release_created }}
32+
run: |
33+
git config user.name github-actions[bot]
34+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
35+
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/googleapis/release-please-action.git"
36+
git tag -d v${{ steps.release.outputs.major }} || true
37+
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
38+
git push origin :v${{ steps.release.outputs.major }} || true
39+
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
40+
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
41+
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
42+
git push origin v${{ steps.release.outputs.major }}
43+
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}

.release-please-manifest.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
".": "1.3.0"
3+
}
4+

release-please-config.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"packages": {
3+
".": {
4+
"changelog-path": "CHANGELOG.md",
5+
"release-type": "python",
6+
"bump-minor-pre-major": false,
7+
"bump-patch-for-minor-pre-major": false,
8+
"draft": false,
9+
"prerelease": false
10+
}
11+
},
12+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
13+
}

0 commit comments

Comments
 (0)