-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (73 loc) · 3.06 KB
/
release.yml
File metadata and controls
88 lines (73 loc) · 3.06 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
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
# Uncomment to add an approval gate before releasing:
# environment: jreleaser
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 22
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
cache: maven
- name: Install MinGW-w64 cross-compiler
run: sudo apt-get install -y mingw-w64
- name: Set release version
run: |
./mvnw --no-transfer-progress --batch-mode versions:set -DnewVersion=${{ inputs.version }} -DprocessAllModules=true versions:commit
find . -name "README.md" -exec sed -i \
-e 's/\(org\.codejive\.miniterm:[^:]*\):[0-9][a-zA-Z0-9._-]*/\1:${{ inputs.version }}/g' \
-e 's|<version>[^<]*</version>|<version>${{ inputs.version }}</version>|g' \
{} \;
find examples -name "*.java" -exec sed -i \
-e 's/\$\{miniterm\.version:[^}]*}/${miniterm.version:${{ inputs.version }}}/g' \
{} \;
- name: Build and deploy to staging
run: ./mvnw --no-transfer-progress --batch-mode clean deploy -Prelease,cross-windows
- name: Commit release version
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add -A
git commit -m "ci: Releasing version ${{ inputs.version }}"
git push
- name: Run JReleaser
run: ./mvnw --no-transfer-progress --batch-mode -N 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" -DprocessAllModules=true versions:commit
- name: Commit next development version
run: |
git add -A
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