Skip to content

Commit 6b62d02

Browse files
authored
Merge branch 'main' into build/refactor-deployment
2 parents 11c9ef7 + 09a7fbe commit 6b62d02

1 file changed

Lines changed: 11 additions & 60 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 11 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,6 @@ jobs:
258258
publish-central:
259259
name: Publish to Maven Central
260260
needs: [build-windows, build-linux, build-macos]
261-
permissions:
262-
contents: read
263-
actions: read
264-
env:
265-
# Single source of truth for the platforms a release must contain.
266-
CLASSIFIERS: "windows-x86_64 linux-x86_64 linux-aarch64 linux-aarch32 macos-x86_64 macos-aarch64"
267261
outputs:
268262
release_body: ${{ needs.build-windows.outputs.release_body }}
269263
release_version: ${{ needs.build-windows.outputs.release_version }}
@@ -315,59 +309,20 @@ jobs:
315309
path: natives
316310
merge-multiple: true
317311

318-
# download-artifact covers the current run *and its earlier attempts*, so
319-
# after "Re-run failed jobs" the jars built in attempt 1 are normally still
320-
# there. Should any be missing anyway, fall back to the REST API, which is
321-
# scoped to the run rather than to a single attempt.
322-
- name: Recover missing native library jars from earlier attempts
323-
env:
324-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
312+
- name: Verify that every platform is present
325313
run: |
326314
version="${{ steps.release-version.outputs.version }}"
327-
missing=()
315+
status=0
328316
329-
for classifier in $CLASSIFIERS; do
317+
for classifier in windows-x86_64 linux-x86_64 linux-aarch64 \
318+
linux-aarch32 macos-x86_64 macos-aarch64; do
330319
if [ ! -f "natives/webrtc-java-$version-$classifier.jar" ]; then
331-
missing+=("$classifier")
320+
echo "::error::Missing native library jar for $classifier"
321+
status=1
332322
fi
333323
done
334324
335-
if [ ${#missing[@]} -eq 0 ]; then
336-
echo "All platforms present, nothing to recover."
337-
exit 0
338-
fi
339-
340-
echo "Missing after download: ${missing[*]}"
341-
echo "Retrying via the artifact list of run ${{ github.run_id }}."
342-
343-
mkdir -p recovered natives
344-
gh run download "${{ github.run_id }}" --pattern 'natives-*' --dir recovered || true
345-
find recovered -name '*.jar' -exec cp -n {} natives/ ';'
346-
rm -rf recovered
347-
348-
# The build jobs run with fail-fast disabled, so a partial matrix result must
349-
# not turn into an incomplete release: a published version is immutable, and
350-
# the missing classifiers could not be added to it afterwards.
351-
- name: Verify that every platform is present
352-
run: |
353-
version="${{ steps.release-version.outputs.version }}"
354-
missing=()
355-
356-
for classifier in $CLASSIFIERS; do
357-
if [ -f "natives/webrtc-java-$version-$classifier.jar" ]; then
358-
echo " ok $classifier"
359-
else
360-
echo " MISSING $classifier"
361-
missing+=("$classifier")
362-
fi
363-
done
364-
365-
if [ ${#missing[@]} -gt 0 ]; then
366-
echo "::error::Incomplete native library set on attempt ${{ github.run_attempt }} (missing: ${missing[*]}). Nothing was published. Use \"Re-run failed jobs\": the rebuilt jars join the ones already built, they do not replace them."
367-
exit 1
368-
fi
369-
370-
echo "Complete set for version $version."
325+
exit $status
371326
372327
# The webrtc module depends on its own native library jar for the host
373328
# platform. That dependency is normally installed by webrtc-jni, which is kept
@@ -404,16 +359,14 @@ jobs:
404359
- name: Summarize what would have been published
405360
if: ${{ inputs.dryRun }}
406361
run: |
407-
version="${{ steps.release-version.outputs.version }}"
408-
409362
{
410-
echo "## Dry run -- nothing was published"
363+
echo "## Dry run — nothing was published"
411364
echo
412-
echo "Version: \`$version\`"
365+
echo "Version: \`${{ steps.release-version.outputs.version }}\`"
413366
echo
414367
echo "Artifacts destined for the deployment bundle:"
415368
echo '```'
416-
find natives target webrtc/target -type f \( -name "*$version*.jar" -o -name "*$version*.pom" -o -name "*$version*.asc" \) | sort
369+
ls -1 webrtc/target/*.jar webrtc/target/*.asc natives/*.asc 2>/dev/null || true
417370
echo '```'
418371
} >> "$GITHUB_STEP_SUMMARY"
419372
@@ -424,12 +377,10 @@ jobs:
424377
name: deployment-bundle-dry-run
425378
path: |
426379
target/central-*/**
427-
target/*.pom.asc
428380
webrtc/target/central-*/**
429381
webrtc/target/*.jar
430-
webrtc/target/*.pom
431382
webrtc/target/*.asc
432-
webrtc/target/gpg/**
383+
natives/*.asc
433384
if-no-files-found: warn
434385
retention-days: 7
435386

0 commit comments

Comments
 (0)