@@ -14,15 +14,17 @@ jobs:
14
14
runs-on : ubuntu-latest
15
15
steps :
16
16
- name : Checkout repository
17
- uses : actions/checkout@v4
17
+ uses : actions/checkout@v5
18
18
with :
19
19
token : ${{ secrets.GH_TOKEN }}
20
20
- uses : gradle/actions/wrapper-validation@v4
21
21
- name : Set up JDK
22
- uses : actions/setup-java@v4
22
+ uses : actions/setup-java@v5
23
23
with :
24
24
distribution : ' temurin'
25
- java-version : ' 17'
25
+ java-version : |
26
+ 17
27
+ 21
26
28
- name : Set the current release version
27
29
id : release_version
28
30
run : echo "release_version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
@@ -45,22 +47,15 @@ jobs:
45
47
DEVELOCITY_CACHE_PASSWORD : ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
46
48
run : |
47
49
echo $GPG_FILE | base64 -d > secring.gpg
50
+ # Publish both locally and to Sonatype.
51
+ # The artifacts stored locally will be used to generate the SLSA provenance.
52
+ ./gradlew publishToMavenCentral --publishing-type=AUTOMATIC
48
53
# Read the current version from gradle.properties.
49
54
VERSION=$(./gradlew properties | grep 'version:' | awk '{print $2}')
50
55
# Read the project group from gradle.properties.
51
56
GROUP_PATH=$(./gradlew properties| grep "projectGroup" | awk '{print $2}' | sed 's/\./\//g')
52
57
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
53
58
echo "group=$GROUP_PATH" >> "$GITHUB_OUTPUT"
54
- # Publish locally
55
- ./gradlew publishAllPublicationsToBuildRepository
56
- # ZIP Artifacts
57
- cd build/repo
58
- zip -r ../../artifacts.zip io
59
- cd ../..
60
- export SONATYPE_BEARER=$(printf "%s:%s" "$SONATYPE_USERNAME" "$SONATYPE_PASSWORD" | base64 | tr -d '\n')
61
- echo "Publishing via the Portal API"
62
- # https://central.sonatype.org/publish/publish-portal-api/#uploading-a-deployment-bundle
63
- curl -X POST https://central.sonatype.com/api/v1/publisher/upload -H "Authorization: Bearer $SONATYPE_BEARER" -F name="$GROUP_PATH $VERSION" -F publishingType="AUTOMATIC" -F [email protected]
64
59
- name : Generate subject
65
60
id : hash
66
61
run : |
@@ -122,7 +117,7 @@ jobs:
122
117
artifacts-sha256 : ${{ steps.set-hash.outputs.artifacts-sha256 }}
123
118
steps :
124
119
- name : Download artifacts-sha256
125
- uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3 .0
120
+ uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0 .0
126
121
with :
127
122
name : artifacts-sha256
128
123
# The SLSA provenance generator expects the hash digest of artifacts to be passed as a job
@@ -153,9 +148,9 @@ jobs:
153
148
if : startsWith(github.ref, 'refs/tags/')
154
149
steps :
155
150
- name : Checkout repository
156
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
151
+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
157
152
- name : Download artifacts
158
- uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3 .0
153
+ uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0 .0
159
154
with :
160
155
name : gradle-build-outputs
161
156
path : build/repo
0 commit comments