-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 2.04 KB
/
release.yml
File metadata and controls
74 lines (65 loc) · 2.04 KB
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
72
73
74
name: Release
on:
workflow_dispatch
jobs:
BumpVersion:
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
env:
CI: true
steps:
- name: Check out
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Check if branch is master
run: |
if [[ "${GITHUB_REF##*/}" != "master" ]]; then
echo "This workflow can only be triggered for the master branch."
exit 1
fi
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GH_TOKEN }}
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
Release:
needs: BumpVersion
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew clean build
- name: Execute Gradle publish
run: ./gradlew publish
- name: Execute Gradle release
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
run: ./gradlew jreleaserFullRelease
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
build/libs
build/publications