-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (64 loc) · 2.64 KB
/
release.yml
File metadata and controls
79 lines (64 loc) · 2.64 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., 1.0.0)'
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # Required to create releases and push commits
# Optional: Use environment for additional protection
# environment: jreleaser
env:
# GitHub token (automatically provided)
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Required for Maven Central deployment
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for changelog generation
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Set release version
run: ./mvnw --no-transfer-progress --batch-mode versions:set -DnewVersion=${{ github.event.inputs.version }}
- name: Build and assemble
run: ./mvnw --no-transfer-progress --batch-mode clean deploy jreleaser:assemble -Prelease
- name: Commit & Push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add pom.xml
git commit -m "ci: Releasing version ${{ github.event.inputs.version }}"
git push
- name: Run JReleaser
run: ./mvnw jreleaser:full-release
- name: Set next development version
run: ./mvnw --no-transfer-progress --batch-mode build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
- name: Commit & Push changes
run: |
git add pom.xml
git commit -m "ci: Prepare for next development iteration"
git push
- name: Upload JReleaser output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-output
path: |
target/jreleaser/trace.log
target/jreleaser/output.properties
retention-days: 7