Skip to content

Commit 8107e50

Browse files
committed
Code cleanup
1 parent b60b898 commit 8107e50

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ 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

.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: 21 additions & 7 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,9 +109,15 @@ jobs:
104109
- uses: actions/checkout@v4
105110
with:
106111
ref: ${{ needs.open-release.outputs.TAG }}
107-
token: ${{ secrets.WORKFLOW_TOKEN }}
108112
fetch-depth: 0
109-
- uses: actions/setup-java@v4
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
110121
with:
111122
distribution: zulu
112123
java-version: 21
@@ -132,11 +143,13 @@ jobs:
132143
./mvnw --batch-mode -V -e -pl '!test,!benchmark,!benchmark/java,!benchmark/guava,!benchmark/assertj'
133144
-Dstaging_repository_id=${{ needs.open-release.outputs.STAGING_REPOSITORY_ID }}
134145
-Dstaging_host="${{ env.STAGING_HOST }}"
135-
deploy -P release
146+
-P release
147+
deploy
136148
149+
# Must quote exclamation mark on bash: https://stackoverflow.com/a/27177197/14731
137150
- name: Generate Javadoc
138151
run: |
139-
./mvnw --batch-mode -V -e javadoc:aggregate
152+
./mvnw --batch-mode -V -e -pl '!test,!benchmark,!benchmark/java,!benchmark/guava,!benchmark/assertj' javadoc:aggregate
140153
mkdir --parents "${{ needs.open-release.outputs.VERSION }}/docs"
141154
mv target/reports/apidocs "${{ needs.open-release.outputs.VERSION }}/docs/api"
142155
@@ -149,13 +162,13 @@ jobs:
149162
git push
150163
151164
close-release:
165+
name: Close release
152166
needs: [ open-release, deploy ]
153167
runs-on: ubuntu-latest
154168
steps:
155169
- uses: actions/checkout@v4
156170
with:
157171
ref: ${{ needs.open-release.outputs.TAG }}
158-
token: ${{ secrets.WORKFLOW_TOKEN }}
159172
- uses: actions/setup-java@v4
160173
with:
161174
distribution: zulu
@@ -182,16 +195,17 @@ jobs:
182195
183196
# Cleanup on failure: https://stackoverflow.com/a/74562058/14731
184197
on-failure:
198+
name: On failure
185199
needs: [ open-release, deploy, close-release ]
186200
runs-on: ubuntu-latest
187201
if: ${{ failure() || cancelled() }}
188202
steps:
189203
- uses: actions/checkout@v4
190204
with:
191205
ref: ${{ github.ref }}
192-
token: ${{ secrets.WORKFLOW_TOKEN }}
193206
fetch-depth: 0
194-
- uses: actions/setup-java@v4
207+
- name: Install Java
208+
uses: actions/setup-java@v4
195209
with:
196210
distribution: zulu
197211
java-version: 21

0 commit comments

Comments
 (0)