-
Notifications
You must be signed in to change notification settings - Fork 233
89 lines (78 loc) · 3.14 KB
/
release.yml
File metadata and controls
89 lines (78 loc) · 3.14 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. 20260101)'
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 11
cache: maven
- name: Set version
run: |
# Configure git for any operations
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
# Check if we already have the release commit
if git log --oneline -10 | grep -q "Release version ${{ github.event.inputs.version }}"; then
echo "Release commit already exists, skipping version setting"
elif [ "$CURRENT_VERSION" != "${{ github.event.inputs.version }}" ]; then
echo "Setting version to ${{ github.event.inputs.version }}"
./mvnw -ntp -B versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.version }}
git add pom.xml "**/pom.xml"
git commit -m "Release version ${{ github.event.inputs.version }}"
git push origin main
else
echo "Version is already set to ${{ github.event.inputs.version }}"
fi
- name: Build
run: ./mvnw -ntp -B -Ppublication
- name: Release
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
JRELEASER_MAVENCENTRAL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
JRELEASER_BLUESKY_HOST: ${{ secrets.BLUESKY_HOST }}
JRELEASER_BLUESKY_HANDLE: ${{ secrets.BLUESKY_HANDLE }}
JRELEASER_BLUESKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }}
run: ./mvnw -ntp -B -N -Ppublication jreleaser:full-release
- name: Release log
if: always()
uses: actions/upload-artifact@v6
with:
name: release
path: |
target/jreleaser/trace.log
target/jreleaser/output.properties
- name: Set next version
run: |
# Configure git (in case it's needed again)
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
echo "Setting next version to 20000101-SNAPSHOT"
./mvnw -ntp -B versions:set -DgenerateBackupPoms=false -DnewVersion=20000101-SNAPSHOT
git add pom.xml "**/pom.xml"
git commit -m "Prepare for next development version"
git push origin main