Skip to content

Commit 9f634c1

Browse files
committed
build: Update release configuration
1 parent 58e9dfa commit 9f634c1

4 files changed

Lines changed: 502 additions & 499 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Java
1717
uses: actions/setup-java@v5
1818
with:
19-
java-version: 1.8
19+
java-version: 21
2020
distribution: zulu
2121
cache: maven
2222

.github/workflows/release.yml

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,52 @@
11
name: Release
22

33
on:
4-
push:
5-
branches: [ master ]
4+
workflow_dispatch:
65

76
jobs:
8-
Release:
7+
release:
98
runs-on: ubuntu-latest
10-
if: github.event_name == 'push' && startsWith(github.event.head_commit.message, '[release]')
119
steps:
1210
- name: Checkout
1311
uses: actions/checkout@v6
1412

1513
- name: Setup Java
1614
uses: actions/setup-java@v5
1715
with:
18-
java-version: 1.8
16+
java-version: 21
1917
distribution: zulu
20-
server-id: central
21-
server-username: MAVEN_USERNAME
22-
server-password: MAVEN_CENTRAL_TOKEN
23-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
24-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2518
cache: maven
2619

2720
- name: Build
28-
run: |
29-
chmod +x mvnw
30-
./mvnw -Pit -B verify --file pom.xml
21+
run: ./mvnw -ntp -B verify
3122

3223
- name: Release
24+
run: |
25+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
git config --global user.name "GitHub Action"
27+
git config --global url."https://x-access-token:${JRELEASER_GITHUB_TOKEN}@github.com/".insteadOf "git@github.com:"
28+
./mvnw -ntp -B -Prelease release:prepare release:perform
3329
env:
34-
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
35-
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
36-
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
30+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
31+
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.JRELEASER_MAVENCENTRAL_TOKEN }}
32+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
33+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
34+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
35+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: JReleaser output
38+
if: always()
39+
uses: actions/upload-artifact@v6
40+
with:
41+
name: jreleaser-release
42+
path: |
43+
target/jreleaser/trace.log
44+
target/jreleaser/output.properties
45+
46+
- name: Update pom
3747
run: |
38-
git config user.name "${{ github.event.head_commit.committer.name }}"
39-
git config user.email "${{ github.event.head_commit.committer.email }}"
40-
./mvnw -B --file pom.xml release:prepare release:perform -Drepository.url=https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
48+
sed -i -e "s@project.build.outputTimestamp>.*</project.build.outputTimestamp@project.build.outputTimestamp>\${git.commit.author.time}</project.build.outputTimestamp@g" pom.xml
49+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
50+
git config --global user.name "GitHub Action"
51+
git commit -a -m "build: Update timestamp expression"
52+
git push origin master
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2-
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
1+
wrapperVersion=3.3.4
2+
distributionType=only-script
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip

0 commit comments

Comments
 (0)