-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (57 loc) · 2.05 KB
/
release.yml
File metadata and controls
67 lines (57 loc) · 2.05 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
name: release
on:
workflow_dispatch:
inputs:
release-version:
description: 'Version being released'
required: true
branch:
description: 'Branch to release from'
required: true
default: 'main'
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Java
uses: actions/setup-java@v5
with:
java-version: 11
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.java_gpg_secret_key }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.java_gpg_secret_key }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Compile
run: mvn --no-transfer-progress --batch-mode clean install
- name: Setup Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
- name: Set the version
run: |
mvn --no-transfer-progress --batch-mode versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.release-version }}
git add .
git commit -m "Release version update ${{ github.event.inputs.release-version }}"
git tag ${{ github.event.inputs.release-version }}
git push origin ${{ github.event.inputs.release-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release to Maven Central
run: |
mvn --no-transfer-progress --batch-mode clean deploy -Prelease -DskipTests=true
env:
MAVEN_USERNAME: ${{ secrets.central_username }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.central_password }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.java_gpg_passphrase }}