Skip to content

Commit 43a7bcb

Browse files
feat: add release-please for automated releases (#306)
Co-authored-by: Shuni <251468265+shuni-bot[bot]@users.noreply.github.com>
1 parent 766d65b commit 43a7bcb

4 files changed

Lines changed: 130 additions & 34 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
release-please:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
release_created: ${{ steps.release.outputs.release_created }}
16+
tag_name: ${{ steps.release.outputs.tag_name }}
17+
steps:
18+
- name: Get token
19+
id: get_token
20+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
21+
with:
22+
private_key: ${{ secrets.RELEASE_APP_PEM }}
23+
app_id: ${{ secrets.RELEASE_APP_ID }}
24+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
25+
id: release
26+
with:
27+
config-file: release-please-config.json
28+
manifest-file: .release-please-manifest.json
29+
token: ${{ steps.get_token.outputs.token }}
30+
31+
publish:
32+
needs: release-please
33+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout Code
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38+
with:
39+
ref: ${{ needs.release-please.outputs.tag_name }}
40+
41+
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
42+
with:
43+
distribution: "zulu"
44+
java-version: 11
45+
check-latest: true
46+
cache: "maven"
47+
server-id: central
48+
server-username: MAVEN_USERNAME
49+
server-password: MAVEN_CENTRAL_TOKEN
50+
gpg-private-key: ${{ secrets.MAVEN_GPG_KEY }}
51+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
52+
53+
- name: Publish with Maven
54+
env:
55+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
56+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
57+
DESCOPE_PROJECT_ID: ${{ secrets.DESCOPE_PROJECT_ID }}
58+
DESCOPE_MANAGEMENT_KEY: ${{ secrets.DESCOPE_MANAGEMENT_KEY }}
59+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
60+
run: mvn -B deploy -P ci

.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.0.62"
3+
}

release-please-config.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "maven",
4+
"include-v-in-tag": false,
5+
"bootstrap-sha": "05b38ac9c97d23f109b84f6dc9d5d73bc943668b",
6+
"packages": {
7+
".": {
8+
"package-name": "java-sdk"
9+
}
10+
},
11+
"changelog-sections": [
12+
{
13+
"type": "feat",
14+
"section": "Features"
15+
},
16+
{
17+
"type": "fix",
18+
"section": "Bug Fixes"
19+
},
20+
{
21+
"type": "perf",
22+
"section": "Performance Improvements"
23+
},
24+
{
25+
"type": "deps",
26+
"section": "Dependencies"
27+
},
28+
{
29+
"type": "revert",
30+
"section": "Reverts"
31+
},
32+
{
33+
"type": "docs",
34+
"section": "Documentation"
35+
},
36+
{
37+
"type": "style",
38+
"section": "Styles",
39+
"hidden": true
40+
},
41+
{
42+
"type": "chore",
43+
"section": "Miscellaneous Chores",
44+
"hidden": true
45+
},
46+
{
47+
"type": "refactor",
48+
"section": "Code Refactoring",
49+
"hidden": true
50+
},
51+
{
52+
"type": "test",
53+
"section": "Tests",
54+
"hidden": true
55+
},
56+
{
57+
"type": "build",
58+
"section": "Build System",
59+
"hidden": true
60+
},
61+
{
62+
"type": "ci",
63+
"section": "Continuous Integration",
64+
"hidden": true
65+
}
66+
]
67+
}

0 commit comments

Comments
 (0)