Skip to content

Commit becb5f0

Browse files
committed
build: Update GH workflows
1 parent 990e7ff commit becb5f0

File tree

4 files changed

+28
-71
lines changed

4 files changed

+28
-71
lines changed

.github/workflows/build.yml

+4-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# SPDX-License-Identifier: Apache-2.0
33
#
4-
# Copyright 2006-2022 the original author or authors.
4+
# Copyright 2006-2024 the original author or authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -32,27 +32,14 @@ jobs:
3232
if: startsWith(github.event.head_commit.message, 'Releasing version') != true
3333

3434
steps:
35-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
3636

3737
- name: Setup Java
38-
uses: actions/setup-java@v3
38+
uses: actions/setup-java@v4
3939
with:
4040
java-version: ${{ env.JAVA_VERSION }}
4141
distribution: ${{ env.JAVA_DISTRO }}
42-
43-
- uses: actions/cache@v3
44-
with:
45-
path: ~/.gradle/caches
46-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
47-
restore-keys: |
48-
${{ runner.os }}-gradle-
49-
50-
- uses: actions/cache@v3
51-
with:
52-
path: ~/.gradle/wrapper
53-
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
54-
restore-keys: |
55-
${{ runner.os }}-gradlew-
42+
cache: gradle
5643

5744
- name: Build
5845
run: ./gradlew build -S

.github/workflows/early-access.yml

+8-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# SPDX-License-Identifier: Apache-2.0
33
#
4-
# Copyright 2006-2022 the original author or authors.
4+
# Copyright 2006-2024 the original author or authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -33,33 +33,21 @@ jobs:
3333
runs-on: ubuntu-latest
3434
steps:
3535
- name: Checkout
36-
uses: actions/checkout@v3
36+
uses: actions/checkout@v4
3737
with:
3838
fetch-depth: 0
3939

40-
- uses: n1hility/cancel-previous-runs@v2
40+
- name: Cancel previous run
41+
uses: styfle/[email protected]
4142
with:
42-
token: ${{ secrets.GITHUB_TOKEN }}
43+
access_token: ${{ secrets.GITHUB_TOKEN }}
4344

4445
- name: Setup Java
45-
uses: actions/setup-java@v3
46+
uses: actions/setup-java@v4
4647
with:
4748
java-version: ${{ env.JAVA_VERSION }}
4849
distribution: ${{ env.JAVA_DISTRO }}
49-
50-
- uses: actions/cache@v3
51-
with:
52-
path: ~/.gradle/caches
53-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
54-
restore-keys: |
55-
${{ runner.os }}-gradle-
56-
57-
- uses: actions/cache@v3
58-
with:
59-
path: ~/.gradle/wrapper
60-
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
61-
restore-keys: |
62-
${{ runner.os }}-gradlew-
50+
cache: gradle
6351

6452
- name: Build
6553
run: ./gradlew -Prelease=true build -S
@@ -78,7 +66,7 @@ jobs:
7866

7967
- name: JReleaser output
8068
if: always()
81-
uses: actions/upload-artifact@v2
69+
uses: actions/upload-artifact@v4
8270
with:
8371
name: artifact
8472
path: |

.github/workflows/release.yml

+15-33
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# SPDX-License-Identifier: Apache-2.0
33
#
4-
# Copyright 2006-2022 the original author or authors.
4+
# Copyright 2006-2024 the original author or authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -37,11 +37,12 @@ jobs:
3737
VERSION: ${{ steps.vars.outputs.VERSION }}
3838
steps:
3939
- name: Checkout
40-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
4141

42-
- uses: n1hility/cancel-previous-runs@v2
42+
- name: Cancel previous run
43+
uses: styfle/[email protected]
4344
with:
44-
token: ${{ secrets.GITHUB_TOKEN }}
45+
access_token: ${{ secrets.GITHUB_TOKEN }}
4546

4647
- name: Version
4748
id: vars
@@ -54,29 +55,16 @@ jobs:
5455
needs: [precheck]
5556
runs-on: ubuntu-latest
5657
steps:
57-
- uses: actions/checkout@v3
58+
- uses: actions/checkout@v4
5859
with:
5960
fetch-depth: 0
6061

6162
- name: Set up Java
62-
uses: actions/setup-java@v3
63+
uses: actions/setup-java@v4
6364
with:
6465
java-version: ${{ env.JAVA_VERSION }}
6566
distribution: ${{ env.JAVA_DISTRO }}
66-
67-
- uses: actions/cache@v3
68-
with:
69-
path: ~/.gradle/caches
70-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
71-
restore-keys: |
72-
${{ runner.os }}-gradle-
73-
74-
- uses: actions/cache@v3
75-
with:
76-
path: ~/.gradle/wrapper
77-
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
78-
restore-keys: |
79-
${{ runner.os }}-gradlew-
67+
cache: gradle
8068

8169
- name: Set release version
8270
run: |
@@ -89,20 +77,9 @@ jobs:
8977
git commit -a -m "Releasing version $VERSION"
9078
git push origin master
9179
92-
- name: Build
93-
run: |
94-
./gradlew -Prelease=true build -S
95-
9680
- name: Deploy
97-
env:
98-
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
99-
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
100-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
10181
run: |
102-
./gradlew -Prelease=true -Pfull-release=true \
103-
-PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} \
104-
-PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} \
105-
build publishToSonatype closeAndReleaseSonatypeStagingRepository -S
82+
./gradlew -Pprofile=sbom -PreproducibleBuild=true publish -S
10683
10784
- name: Release
10885
uses: jreleaser/release-action@v2
@@ -111,14 +88,19 @@ jobs:
11188
env:
11289
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
11390
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
92+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
93+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
94+
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
95+
JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
11496
JRELEASER_TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
11597
JRELEASER_TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
11698
JRELEASER_TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
11799
JRELEASER_TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
118100

119101
- name: JReleaser output
120102
if: always()
121-
uses: actions/upload-artifact@v2
103+
uses: actions/upload-artifact@v4
122104
with:
123105
name: artifact
124106
path: |

jreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ deploy:
7676

7777
announce:
7878
twitter:
79-
active: release
79+
active: RELEASE

0 commit comments

Comments
 (0)