Skip to content

Commit 6ca1bde

Browse files
authored
update workflows (#206)
* update workflows Signed-off-by: Sebastian Hoß <seb@xn--ho-hia.de>
1 parent 106da83 commit 6ca1bde

File tree

12 files changed

+218
-169
lines changed

12 files changed

+218
-169
lines changed

.github/actions/managed-java/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ runs:
1313
java-package: jdk
1414
architecture: x64
1515
distribution: temurin
16+
cache: maven

.github/actions/managed-maven/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ runs:
1313
java-package: jdk
1414
architecture: x64
1515
distribution: temurin
16+
cache: maven
1617
server-id: ossrh
1718
server-username: MAVEN_CENTRAL_USERNAME
1819
server-password: MAVEN_CENTRAL_TOKEN

.github/dependabot.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,13 @@ jobs:
1919
language: [ java ]
2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v3
23-
- name: Set up Java
24-
uses: actions/setup-java@v3
25-
with:
26-
java-version: 17
27-
java-package: jdk
28-
architecture: x64
29-
distribution: temurin
30-
- name: Cache Maven Artifacts
31-
uses: actions/cache@v3
32-
with:
33-
path: ~/.m2/repository
34-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
35-
restore-keys: |
36-
${{ runner.os }}-maven-
22+
uses: actions/checkout@v4
23+
- uses: ./.github/actions/managed-java
3724
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@v2
25+
uses: github/codeql-action/init@v3
3926
with:
4027
languages: ${{ matrix.language }}
4128
- name: Autobuild
4229
uses: github/codeql-action/autobuild@v2
4330
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@v2
31+
uses: github/codeql-action/analyze@v3

.github/workflows/release.yml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Automated Release
55
on:
66
schedule:
7-
- cron: 45 3 * * TUE
7+
- cron: 35 5 * * MON
88
workflow_dispatch:
99
jobs:
1010
publish:
@@ -14,10 +14,17 @@ jobs:
1414
steps:
1515
- id: checkout
1616
name: Clone Git Repository
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- id: last_release
21+
name: Fetch last release info
22+
run: echo "tag=$(gh release view --json tagName --jq '.tagName')" >> $GITHUB_OUTPUT
23+
env:
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1825
- id: commits
1926
name: Count Commits
20-
run: echo "count=$(git rev-list --count HEAD --since='last Tuesday')" >> $GITHUB_OUTPUT
27+
run: echo "count=$(git rev-list --count ${{ steps.last_release.outputs.tag }}..HEAD -- pom.xml memoization-core/pom.xml memoization-core/src/main/java memoization-jdk/pom.xml memoization-jdk/src/main/java memoization-jool/pom.xml memoization-jool/src/main/java memoization-lambda/pom.xml memoization-lambda/src/main/java memoization-rxjava/pom.xml memoization-rxjava/src/main/java)" >> $GITHUB_OUTPUT
2128
- id: release
2229
name: Create Release Version
2330
if: steps.commits.outputs.count > 0
@@ -30,24 +37,16 @@ jobs:
3037
name: Build Timestamp
3138
if: steps.commits.outputs.count > 0
3239
run: echo "iso8601=$(date --utc --iso-8601=seconds)" >> $GITHUB_OUTPUT
33-
- uses: ./.github/actions/managed-maven
40+
- id: setup-java
41+
uses: ./.github/actions/managed-maven
3442
if: steps.commits.outputs.count > 0
35-
- id: cache
36-
name: Cache Dependencies
37-
if: steps.commits.outputs.count > 0
38-
uses: actions/cache@v3
39-
with:
40-
path: ~/.m2/repository
41-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
42-
restore-keys: |
43-
${{ runner.os }}-maven-
4443
- id: gpg
4544
name: GPG Key
4645
if: steps.commits.outputs.count > 0
47-
uses: timheuer/base64-to-file@v1.2
46+
uses: timheuer/base64-to-file@v1
4847
with:
4948
fileName: signing.key.asc
50-
fileDir: ${{ github.workspace}}
49+
fileDir: ${{ github.workspace }}
5150
encodedString: ${{ secrets.GPG_SECRET_KEY_BASE64 }}
5251
- id: pom-version
5352
name: Set Release Version
@@ -56,15 +55,15 @@ jobs:
5655
- id: deploy-maven
5756
name: Deploy Maven Artifact
5857
if: steps.commits.outputs.count > 0
59-
run: |
60-
mvn \
61-
--batch-mode \
62-
--activate-profiles release \
63-
--define scmTag=${{ steps.sha.outputs.sha }} \
64-
--define pgp.secretkey=keyfile:${{ steps.gpg.outputs.filePath }} \
65-
--define pgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }} \
66-
--define project.build.outputTimestamp=${{ steps.timestamp.outputs.iso8601 }} \
67-
deploy
58+
run: >
59+
mvn
60+
--batch-mode
61+
--activate-profiles release
62+
--define scmTag=${{ steps.sha.outputs.sha }}
63+
--define pgp.secretkey=keyfile:${{ steps.gpg.outputs.filePath }}
64+
--define pgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }}
65+
--define project.build.outputTimestamp=${{ steps.timestamp.outputs.iso8601 }}
66+
deploy
6867
env:
6968
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
7069
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
@@ -83,7 +82,7 @@ jobs:
8382
- id: mail
8483
name: Send Mail
8584
if: steps.commits.outputs.count > 0
86-
uses: dawidd6/action-send-mail@v3.7.1
85+
uses: dawidd6/action-send-mail@v3
8786
with:
8887
server_address: ${{ secrets.MAIL_SERVER }}
8988
server_port: ${{ secrets.MAIL_PORT }}

.github/workflows/reuse.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
name: REUSE compliance
55
on:
6-
push:
7-
branches: [ main ]
86
pull_request:
97
branches: [ main ]
108
jobs:
119
reuse:
1210
runs-on: ubuntu-latest
1311
steps:
14-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1513
- name: REUSE Compliance Check
16-
uses: fsfe/reuse-action@v1
14+
uses: fsfe/reuse-action@v2

.github/workflows/update-parent.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,13 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Clone Git Repository
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
- uses: ./.github/actions/managed-java
15-
- uses: actions/cache@v3
16-
with:
17-
path: ~/.m2/repository
18-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
19-
restore-keys: |
20-
${{ runner.os }}-maven-
2115
- name: Update Parent
2216
run: mvn --batch-mode --define generateBackupPoms=false versions:update-parent
2317
- id: cpr
2418
name: Create Pull Request
25-
uses: peter-evans/create-pull-request@v4
19+
uses: peter-evans/create-pull-request@v5
2620
with:
2721
token: ${{ secrets.PAT }}
2822
commit-message: Update parent to latest version
@@ -41,8 +35,6 @@ jobs:
4135
delete-branch: true
4236
- name: Enable Pull Request Automerge
4337
if: steps.cpr.outputs.pull-request-operation == 'created'
44-
uses: peter-evans/enable-pull-request-automerge@v2
45-
with:
46-
token: ${{ secrets.PAT }}
47-
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
48-
merge-method: rebase
38+
run: gh pr merge --rebase --auto ${{ steps.cpr.outputs.pull-request-number }}
39+
env:
40+
GH_TOKEN: ${{ secrets.PAT }}

.github/workflows/verify.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,12 @@ name: Verify Commits
55
on:
66
pull_request:
77
branches: [ main ]
8-
push:
9-
branches: [ main ]
108
jobs:
119
verify:
1210
runs-on: ubuntu-latest
1311
steps:
1412
- name: Clone Git Repository
15-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1614
- uses: ./.github/actions/managed-java
17-
- name: Cache Dependencies
18-
uses: actions/cache@v3
19-
with:
20-
path: ~/.m2/repository
21-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
22-
restore-keys: |
23-
${{ runner.os }}-maven-
2415
- name: Build with Maven
2516
run: mvn --batch-mode verify

0 commit comments

Comments
 (0)