Skip to content

Commit a1db00f

Browse files
committed
Code cleanup
1 parent 977cf02 commit a1db00f

File tree

3 files changed

+28
-37
lines changed

3 files changed

+28
-37
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ jobs:
1313
os: [ windows-latest, ubuntu-latest, macos-latest ]
1414
steps:
1515
- uses: actions/checkout@v4
16-
- uses: actions/setup-java@v4
16+
- name: Install Java
17+
uses: actions/setup-java@v4
1718
with:
1819
distribution: zulu
1920
java-version: 21
2021

2122
- name: Cache Dependencies
2223
uses: actions/cache@v4
2324
with:
24-
path: |
25-
~/.m2/repository/*
25+
path: ~/.m2/repository/*
2626
key: ${{ runner.OS }}-maven-${{ hashFiles('**/pom.xml') }}
2727

2828
# Maven command-line options:

.github/workflows/cla.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
pull_request_target:
77
types: [ opened,closed,synchronize ]
88

9-
# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings
109
permissions:
1110
actions: write
1211
contents: write
@@ -17,14 +16,10 @@ jobs:
1716
CLAAssistant:
1817
runs-on: ubuntu-latest
1918
steps:
20-
- name: "CLA Assistant"
19+
# https://github.com/contributor-assistant/github-action
20+
- name: "CLA Assistant Lite"
2121
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
2222
uses: contributor-assistant/github-action@v2.3.0
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25-
# the below token should have repo scope and must be manually added by you in the repository's secret
26-
# This token is required only if you have configured to store the signatures in a remote repository/organization
27-
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ACCESS_TOKEN }}
2823
with:
2924
path-to-signatures: 'cla/version1/signatures/cla.json'
3025
path-to-document: 'https://github.com/cowwoc/requirements.java/blob/master/cla/version1/cla.md' # e.g. a CLA or a DCO document

.github/workflows/deploy_to_maven_central.yml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ on:
77
concurrency:
88
group: "${{ github.workflow }}-${{ github.ref }}"
99
cancel-in-progress: true
10+
permissions:
11+
contents: write
12+
id-token: write
13+
1014
env:
1115
STAGING_HOST: "oss.sonatype.org"
1216
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
1317
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
1418
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
1519
jobs:
1620
open-release:
21+
name: Open release
1722
runs-on: ubuntu-latest
1823
outputs:
1924
INITIAL_MASTER_POSITION: ${{ steps.create-tag.outputs.INITIAL_MASTER_POSITION }}
@@ -104,7 +109,15 @@ jobs:
104109
- uses: actions/checkout@v4
105110
with:
106111
ref: ${{ needs.open-release.outputs.TAG }}
107-
- uses: actions/setup-java@v4
112+
fetch-depth: 0
113+
114+
- name: Configure Git User
115+
run: |
116+
git config user.email "cowwoc2020@gmail.com"
117+
git config user.name "Gili Tzabari"
118+
119+
- name: Install Java
120+
uses: actions/setup-java@v4
108121
with:
109122
distribution: zulu
110123
java-version: 21
@@ -130,31 +143,13 @@ jobs:
130143
./mvnw --batch-mode -V -e -pl '!test,!benchmark,!benchmark/java,!benchmark/guava,!benchmark/assertj'
131144
-Dstaging_repository_id=${{ needs.open-release.outputs.STAGING_REPOSITORY_ID }}
132145
-Dstaging_host="${{ env.STAGING_HOST }}"
133-
deploy -P release
134-
135-
document:
136-
name: Publish Javadoc documentation
137-
needs: [ open-release, deploy ]
138-
runs-on: ubuntu-latest
139-
steps:
140-
- uses: actions/checkout@v4
141-
with:
142-
ref: ${{ needs.open-release.outputs.TAG }}
143-
fetch-depth: 0
144-
token: ${{ secrets.WORKFLOW_TOKEN }}
145-
- uses: actions/setup-java@v4
146-
with:
147-
distribution: zulu
148-
java-version: 21
149-
150-
- name: Configure Git User
151-
run: |
152-
git config user.email "cowwoc2020@gmail.com"
153-
git config user.name "Gili Tzabari"
146+
-P release
147+
deploy
154148
149+
# Must quote exclamation mark on bash: https://stackoverflow.com/a/27177197/14731
155150
- name: Generate Javadoc
156151
run: |
157-
./mvnw --batch-mode -V -e verify javadoc:aggregate
152+
./mvnw --batch-mode -V -e -pl '!test,!benchmark,!benchmark/java,!benchmark/guava,!benchmark/assertj' javadoc:aggregate
158153
mkdir --parents "${{ needs.open-release.outputs.VERSION }}/docs"
159154
mv target/reports/apidocs "${{ needs.open-release.outputs.VERSION }}/docs/api"
160155
@@ -167,13 +162,13 @@ jobs:
167162
git push
168163
169164
close-release:
170-
needs: [ open-release, deploy, document ]
165+
name: Close release
166+
needs: [ open-release, deploy ]
171167
runs-on: ubuntu-latest
172168
steps:
173169
- uses: actions/checkout@v4
174170
with:
175171
ref: ${{ needs.open-release.outputs.TAG }}
176-
token: ${{ secrets.WORKFLOW_TOKEN }}
177172
- uses: actions/setup-java@v4
178173
with:
179174
distribution: zulu
@@ -200,6 +195,7 @@ jobs:
200195
201196
# Cleanup on failure: https://stackoverflow.com/a/74562058/14731
202197
on-failure:
198+
name: On failure
203199
needs: [ open-release, deploy, close-release ]
204200
runs-on: ubuntu-latest
205201
if: ${{ failure() || cancelled() }}
@@ -208,8 +204,8 @@ jobs:
208204
with:
209205
ref: ${{ github.ref }}
210206
fetch-depth: 0
211-
token: ${{ secrets.WORKFLOW_TOKEN }}
212-
- uses: actions/setup-java@v4
207+
- name: Install Java
208+
uses: actions/setup-java@v4
213209
with:
214210
distribution: zulu
215211
java-version: 21

0 commit comments

Comments
 (0)