-
Notifications
You must be signed in to change notification settings - Fork 7
76 lines (62 loc) · 2.26 KB
/
release-please.yml
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
name: release-please
on:
pull_request:
types:
- closed
branches:
- main
permissions:
contents: write
pull-requests: write
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# Only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }}
# Skip the release process in the fork
# The pull request should come from the same repo (github_token from the fork does not have write permissions)
if: github.repository_owner == 'OKDP' && github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: google-github-actions/release-please-action@v4
id: release-please
publish-maven-central:
runs-on: ubuntu-latest
needs: [release-please]
if: github.repository_owner == 'OKDP' && needs.release-please.outputs.release_created == 'true'
steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up GitHub Actions git bot 📦
uses: ./.github/actions/setup-git-bot
- name: Set up JDK 11 📦
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
cache: 'maven'
check-latest: true
server-id: 'central'
server-username: CENTRAL_USERNAME
server-password: CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Publish the tag '${{ needs.release-please.outputs.tag_name }}' to maven central 📤
run: |
git checkout tags/${{ needs.release-please.outputs.tag_name }}
mvn clean deploy -Prelease -DskipTests
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}