3434 SHA=$(git rev-parse HEAD)
3535 echo "sha=$SHA" >> "$GITHUB_OUTPUT"
3636
37+ build-linux-arm64-classifier :
38+ name : Build Linux ARM64 snapshot classifier
39+ needs : resolve-source
40+ runs-on : ubuntu-24.04-arm
41+ permissions :
42+ contents : read
43+ outputs :
44+ version : ${{ steps.build.outputs.version }}
45+ defaults :
46+ run :
47+ shell : bash
48+ working-directory : ./java
49+ steps :
50+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
51+ with :
52+ ref : ${{ github.sha }}
53+ fetch-depth : 1
54+ persist-credentials : false
55+
56+ - uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
57+ with :
58+ java-version : " 25"
59+ distribution : " microsoft"
60+ cache : " maven"
61+
62+ - uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
63+ with :
64+ node-version : 22
65+
66+ - name : Build and validate linux-arm64 classifier
67+ id : build
68+ run : |
69+ set -euo pipefail
70+ SOURCE_COMMIT=$(git rev-parse HEAD)
71+ if [ "$SOURCE_COMMIT" != "${{ needs.resolve-source.outputs.source_sha }}" ]; then
72+ echo "::error::Checked out $SOURCE_COMMIT instead of the resolved snapshot source."
73+ exit 1
74+ fi
75+ node copilot-native/scripts/validate-native-host.mjs linux-arm64
76+ mvn -B -pl copilot-native package -DskipTests -Dcopilot.native.libc=glibc
77+ VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
78+ JAR="copilot-native/target/copilot-sdk-java-runtime-$VERSION-linux-arm64.jar"
79+ PRIMARY_JAR="copilot-native/target/copilot-sdk-java-runtime-$VERSION.jar"
80+ test -f "$JAR"
81+ node copilot-native/scripts/validate-native-artifact.mjs \
82+ classifier linux-arm64 "$JAR" "$(basename "$JAR")" ..
83+ node copilot-native/scripts/validate-native-artifact.mjs placeholder "$PRIMARY_JAR"
84+ MANIFEST="copilot-native/target/linux-arm64-$VERSION.sha256"
85+ HASH=$(sha256sum "$JAR" | cut -d ' ' -f 1)
86+ printf '%s %s' "$HASH" "$(basename "$JAR")" > "$MANIFEST"
87+ node copilot-native/scripts/validate-native-artifact.mjs \
88+ checksum "$JAR" "$MANIFEST" "$(basename "$JAR")"
89+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
90+
91+ - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
92+ with :
93+ name : java-native-linux-arm64-snapshot-${{ github.run_id }}-${{ github.run_attempt }}
94+ path : |
95+ java/copilot-native/target/copilot-sdk-java-runtime-${{ steps.build.outputs.version }}-linux-arm64.jar
96+ java/copilot-native/target/linux-arm64-${{ steps.build.outputs.version }}.sha256
97+ if-no-files-found : error
98+ retention-days : 1
99+
37100 build-windows-classifier :
38101 name : Build Windows snapshot classifier
39102 needs : resolve-source
@@ -160,7 +223,13 @@ jobs:
160223
161224 deploy-snapshot :
162225 name : Publish SNAPSHOT to Maven Central
163- needs : [resolve-source, build-windows-classifier, build-darwin-classifier]
226+ needs :
227+ [
228+ resolve-source,
229+ build-linux-arm64-classifier,
230+ build-windows-classifier,
231+ build-darwin-classifier,
232+ ]
164233 runs-on : ubuntu-latest
165234 defaults :
166235 run :
@@ -188,6 +257,11 @@ jobs:
188257 with :
189258 node-version : 22
190259
260+ - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
261+ with :
262+ name : java-native-linux-arm64-snapshot-${{ github.run_id }}-${{ github.run_attempt }}
263+ path : ${{ runner.temp }}/java-native-linux-arm64
264+
191265 - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
192266 with :
193267 name : java-native-win32-x64-snapshot-${{ github.run_id }}-${{ github.run_attempt }}
@@ -198,8 +272,8 @@ jobs:
198272 name : java-native-darwin-arm64-snapshot-${{ github.run_id }}-${{ github.run_attempt }}
199273 path : ${{ runner.temp }}/java-native-darwin-arm64
200274
201- - name : Verify version, source, and Windows classifier
202- id : windows -artifact
275+ - name : Verify version, source, and Linux ARM64 classifier
276+ id : linux-arm64 -artifact
203277 run : |
204278 SOURCE_COMMIT=$(git rev-parse HEAD)
205279 if [ "$SOURCE_COMMIT" != "${{ needs.resolve-source.outputs.source_sha }}" ]; then
@@ -211,6 +285,32 @@ jobs:
211285 echo "::error::This workflow only publishes SNAPSHOT versions. Current version: $VERSION"
212286 exit 1
213287 fi
288+ if [ "$VERSION" != "${{ needs.build-linux-arm64-classifier.outputs.version }}" ]; then
289+ echo "::error::Linux ARM64 classifier version does not match deploy version."
290+ exit 1
291+ fi
292+ ARTIFACT_DIRECTORY="${{ runner.temp }}/java-native-linux-arm64"
293+ JAR="$ARTIFACT_DIRECTORY/copilot-sdk-java-runtime-$VERSION-linux-arm64.jar"
294+ MANIFEST="$ARTIFACT_DIRECTORY/linux-arm64-$VERSION.sha256"
295+ test -f "$JAR"
296+ test -f "$MANIFEST"
297+ node "$GITHUB_WORKSPACE/java/copilot-native/scripts/validate-native-artifact.mjs" \
298+ checksum "$JAR" "$MANIFEST" "$(basename "$JAR")"
299+ node "$GITHUB_WORKSPACE/java/copilot-native/scripts/validate-native-artifact.mjs" \
300+ classifier linux-arm64 "$JAR" "$(basename "$JAR")" "$GITHUB_WORKSPACE"
301+ echo "linux_arm64_jar=$JAR" >> "$GITHUB_OUTPUT"
302+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
303+ echo "linux_arm64_sha=$(cut -d ' ' -f 1 "$MANIFEST")" >> "$GITHUB_OUTPUT"
304+
305+ - name : Verify version, source, and Windows classifier
306+ id : windows-artifact
307+ run : |
308+ SOURCE_COMMIT=$(git rev-parse HEAD)
309+ if [ "$SOURCE_COMMIT" != "${{ needs.resolve-source.outputs.source_sha }}" ]; then
310+ echo "::error::Checked out $SOURCE_COMMIT instead of the resolved snapshot source."
311+ exit 1
312+ fi
313+ VERSION="${{ steps.linux-arm64-artifact.outputs.version }}"
214314 if [ "$VERSION" != "${{ needs.build-windows-classifier.outputs.version }}" ]; then
215315 echo "::error::Windows classifier version does not match deploy version."
216316 exit 1
@@ -257,6 +357,7 @@ jobs:
257357 run : |
258358 VERSION="${{ steps.windows-artifact.outputs.version }}"
259359 mvn -B deploy -DskipTests -Dcopilot.native.libc=glibc \
360+ "-Dcopilot.native.external.linux.arm64.classifier.path=${{ steps.linux-arm64-artifact.outputs.linux_arm64_jar }}" \
260361 "-Dcopilot.native.external.win32.classifier.path=${{ steps.windows-artifact.outputs.windows_jar }}" \
261362 "-Dcopilot.native.external.darwin.classifier.path=${{ steps.darwin-artifact.outputs.darwin_jar }}"
262363 LINUX_JAR="copilot-native/target/copilot-sdk-java-runtime-$VERSION-linux-x64.jar"
@@ -292,6 +393,7 @@ jobs:
292393 echo "| Classifier | Build runner | Artifact | SHA-256 | Status |"
293394 echo "| --- | --- | --- | --- | --- |"
294395 echo "| \`linux-x64\` | \`ubuntu-latest\` | \`$(basename "$LINUX_JAR")\` | \`$LINUX_SHA\` | Published |"
396+ echo "| \`linux-arm64\` | \`ubuntu-24.04-arm\` | \`$(basename "${{ steps.linux-arm64-artifact.outputs.linux_arm64_jar }}")\` | \`${{ steps.linux-arm64-artifact.outputs.linux_arm64_sha }}\` | Published |"
295397 echo "| \`win32-x64\` | \`windows-latest\` | \`$(basename "${{ steps.windows-artifact.outputs.windows_jar }}")\` | \`${{ steps.windows-artifact.outputs.windows_sha }}\` | Published |"
296398 echo "| \`darwin-arm64\` | \`macos-26\` | \`$(basename "${{ steps.darwin-artifact.outputs.darwin_jar }}")\` | \`${{ steps.darwin-artifact.outputs.darwin_sha }}\` | Published |"
297399 } >> "$GITHUB_STEP_SUMMARY"
0 commit comments