-
Notifications
You must be signed in to change notification settings - Fork 252
86 lines (74 loc) · 2.58 KB
/
release.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
passphrase:
description: "GPG passphrase"
required: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Cache Maven
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set version
run: |
VERSION=${{ github.event.inputs.version }}
echo "Releasing $VERSION"
mvn -B versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false -f pom.xml
mvn -B versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false -f benchmark/pom.xml
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Build
run: |
export GPG_TTY=$(tty)
mvn --no-transfer-progress -B --file pom.xml verify -Dgpg.passphrase=${{ github.event.inputs.passphrase }}
- name: Commit version
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Action"
git commit -a -m "Releasing version $VERSION"
git push origin
- name: Release to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
run: |
export GPG_TTY=$(tty)
mvn --no-transfer-progress -B --file pom.xml \
-Drepository.url=https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git \
-Dgpg.passphrase=${{ github.event.inputs.passphrase }} \
deploy
- name: Release to GitHub
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn -B --file pom.xml jreleaser:release
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v2
with:
name: jreleaser-logs
path: |
target/jreleaser/trace.log
target/jreleaser/output.properties