diff --git a/.github/workflows/dev-release.yaml b/.github/workflows/dev-release.yaml index 0cfea5c76b..ec7eddfc5e 100644 --- a/.github/workflows/dev-release.yaml +++ b/.github/workflows/dev-release.yaml @@ -13,16 +13,22 @@ concurrency: jobs: build: - runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + include: + - runner: ubuntu-22.04 + arch: x86_64 + - runner: ubuntu-22.04-arm + arch: aarch64 + runs-on: ${{ matrix.runner }} steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 + - uses: actions/checkout@v7 - - name: Install pinned Rust toolchain + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: - toolchain: "1.89.0" + toolchain: stable - name: Show toolchain run: | @@ -30,36 +36,58 @@ jobs: cargo --version --verbose - name: Build cloud-hypervisor (release) + run: cargo build --release + + - name: Stage artifacts run: | - cargo build --release + set -euo pipefail + mkdir -p dist + cp -v target/release/cloud-hypervisor "dist/cloud-hypervisor-${{ matrix.arch }}" + "./dist/cloud-hypervisor-${{ matrix.arch }}" --version + rustc --version --verbose | tr '\n' ';' > "dist/rustc-${{ matrix.arch }}.txt" - - name: Generate checksum and build metadata + - uses: actions/upload-artifact@v7 + with: + name: dist-${{ matrix.arch }} + path: dist/ + + release: + needs: build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - uses: actions/download-artifact@v8 + with: + pattern: dist-* + merge-multiple: true + path: dist + + - name: Add provenance and checksums run: | - artifact=target/release/cloud-hypervisor - sha256sum "$artifact" > "${artifact}.sha256" - cat > target/release/build-info.json < dist/build-info.json < SHA256SUMS) + cat dist/SHA256SUMS - name: Create dev release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: tag_name: dev target_commitish: ${{ github.sha }} @@ -68,10 +96,7 @@ jobs: Branch: `${{ github.ref_name }}` Commit: `${{ github.sha }}` Workflow Run: `${{ github.run_id }}` - files: | - target/release/cloud-hypervisor - target/release/cloud-hypervisor.sha256 - target/release/build-info.json + files: dist/* prerelease: true make_latest: false overwrite_files: true