Skip to content

Consolidate Native Build Workflows & Implement Secure Release Manifests#2348

Open
dividedmind wants to merge 2 commits intomainfrom
ci/publish-manifests
Open

Consolidate Native Build Workflows & Implement Secure Release Manifests#2348
dividedmind wants to merge 2 commits intomainfrom
ci/publish-manifests

Conversation

@dividedmind
Copy link
Collaborator

Summary

This PR consolidates fragmented native build workflows into a single, optimized pipeline and introduces a secure release manifest publication process (based on the proposal in #2346). It significantly improves CI efficiency, security, and maintainability by removing redundant scripts, updating actions, and enforcing integrity checks before release finalization.

Key Changes

🚀 CI Optimization & Refactoring

  • Consolidated Workflows: Merged build-native.yml and build-native-scanner.yml into a single, unified workflow.
  • Cleanup: Removed unused build and hashing scripts (bin/build-native, bin/hash, bin/hash.js).
  • Dependency Updates: Upgraded core GitHub Actions (checkout, cache, setup-node, artifact handling) to their latest major versions.
  • Bug Fixes:
    • Fixed deprecated set-output commands.
    • Corrected runner architecture for macOS x64 builds.
    • Ensured Node.js is properly set up in the finalize-release job.

🔒 Security & Release Management

  • Secure Release Process: Split the release process into distinct binary upload and finalization steps.
  • Integrity Verification: Implemented strict sha256sum --check verification of assets before finalizing a release.
  • Manifest Publishing: Added automated generation and publishing of release manifests to a release-manifests orphan branch.
  • Least Privilege: Applied explicit permissions scopes (defaulting to contents: read), granting contents: write only to the release finalization job.
  • Standardization: Replaced third-party upload actions and custom PATs with the native gh CLI and the built-in GITHUB_TOKEN.

⚡ Performance

  • Concurrency Control: Added logic to automatically cancel outdated builds on PR updates.
  • Timeouts: Defined explicit timeouts (5-60 mins) for all jobs to prevent stalled runners.
  • Leaner Runners: Switched bookkeeping jobs to ubuntu-slim images.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates the native binary build/release workflows into a single pipeline that builds @appland/appmap and @appland/scanner binaries across platforms, uploads artifacts, and (on tags) finalizes GitHub releases while publishing JSON release manifests to a dedicated release-manifests branch.

Changes:

  • Merged native build workflows (appmap + scanner) into .github/workflows/build-native.yml, adding a setup job to route builds based on tag type.
  • Reworked release finalization to download artifacts, upload via gh release upload, generate manifest JSON, and publish to release-manifests.
  • Removed legacy helper scripts (bin/build-native, bin/hash, bin/hash.js) and deleted the scanner-specific workflow.

Reviewed changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
bin/hash.js Removes Node-based hashing helper script.
bin/hash Removes bash-based hashing helper script.
bin/build-native Removes legacy wrapper that built/signed/notarized/hashed binaries.
.github/workflows/build-native.yml Consolidates multi-package native builds and adds release finalization + manifest publishing.
.github/workflows/build-native-scanner.yml Removes the now-redundant scanner-specific workflow.
.github/actions/setup-node/action.yml Updates Node setup composite action (node setup + caching + output handling).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Merged duplicate workflows and significantly improved the native build pipeline:

Consolidation & DRY:
- Merged build-native.yml and build-native-scanner.yml into single workflow
- Removed unused scripts: bin/build-native, bin/hash, bin/hash.js

Release Management:
- Centralized all release uploads in finalize-release job
- Replaced svenstaro/upload-release-action with native gh CLI
- Removed manual checksum generation (GitHub provides manifests)

Security & Best Practices:
- Added explicit least-privilege permissions (contents: read by default)
- Only finalize-release has contents: write permission
- Replaced custom PAT with built-in GITHUB_TOKEN
- Added concurrency control to cancel outdated PR builds
- Added timeouts to all jobs (5-60 min based on complexity)
- Use ubuntu-slim for bookkeeping jobs

Dependencies & Fixes:
- Updated all GitHub Actions to latest versions:
  • checkout: v3 → v6
  • cache: v3 → v5
  • setup-node: v4 → v6
  • upload-artifact: v4 → v6
  • download-artifact: v4 → v7
- Fixed deprecated set-output command in setup-node action
- Fixed missing Node.js setup in finalize-release job
- Actually use x64 macos runner to build for x64
- Made code signing optional for non-tag builds
…y verification

- Add `merge-multiple: true` to `download-artifact` to flatten asset structure.
- Split GitHub release process into binary upload and final publication steps.
- Implement manifest generation using `gh` and `jq`.
- Add strict SHA256 integrity verification using `sha256sum --check` before release finalization.
- Add automated publishing of manifests to the `release-manifests` orphan branch.

This ensures a secure, verifiable release pipeline where public manifests and tags are only
updated after successful asset validation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant