Skip to content

Commit 921a3f3

Browse files
authored
ci: integrate Google Release-Please with trusted publishing (#719)
1 parent 91b364a commit 921a3f3

File tree

4 files changed

+94
-30
lines changed

4 files changed

+94
-30
lines changed

.github/workflows/python-publish.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions: {}
9+
10+
jobs:
11+
release-please:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
18+
steps:
19+
- name: Generate GitHub App Token
20+
id: app-token
21+
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1
22+
with:
23+
app-id: ${{ secrets.RELEASE_BOT_APP_ID }}
24+
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
25+
26+
- uses: googleapis/release-please-action@c3fc4de07084f75a2b61a5b933069bda6edf3d5c # v4
27+
id: release
28+
with:
29+
token: ${{ steps.app-token.outputs.token }}
30+
config-file: release-please-config.json
31+
manifest-file: .release-please-manifest.json
32+
33+
publish:
34+
needs: release-please
35+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
36+
runs-on: ubuntu-latest
37+
environment: pypi
38+
permissions:
39+
contents: read
40+
id-token: write
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
44+
with:
45+
ref: ${{ needs.release-please.outputs.tag_name }}
46+
47+
- name: Setup
48+
uses: descope/.github/.github/actions/python/poetry/setup@main
49+
with:
50+
python-version: "3.11"
51+
52+
- name: Build
53+
uses: descope/.github/.github/actions/python/poetry/build@main
54+
55+
- name: Publish to PyPI
56+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.7.14"
3+
}

release-please-config.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"bootstrap-sha": "9ad71ffd7cdb956850a292073a3492669231936c",
4+
"release-type": "python",
5+
"packages": {
6+
".": {
7+
"package-name": "descope",
8+
"changelog-path": "CHANGELOG.md",
9+
"extra-files": [
10+
{
11+
"type": "toml",
12+
"path": "pyproject.toml",
13+
"jsonpath": "$.tool.poetry.version"
14+
}
15+
]
16+
}
17+
},
18+
"include-v-in-tag": false,
19+
"bump-minor-pre-major": true,
20+
"bump-patch-for-minor-pre-major": true,
21+
"sequential-calls": false,
22+
"pull-request-title-pattern": "chore: release ${version}",
23+
"changelog-sections": [
24+
{ "type": "feat", "section": "Features" },
25+
{ "type": "fix", "section": "Bug Fixes" },
26+
{ "type": "perf", "section": "Performance Improvements" },
27+
{ "type": "revert", "section": "Reverts" },
28+
{ "type": "docs", "section": "Documentation" },
29+
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": true },
30+
{ "type": "refactor", "section": "Code Refactoring", "hidden": true },
31+
{ "type": "test", "section": "Tests", "hidden": true },
32+
{ "type": "build", "section": "Build System", "hidden": true },
33+
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
34+
]
35+
}

0 commit comments

Comments
 (0)