From 6ff6fc6a910ec0e75145e093e848758c31c5b2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Thu, 26 Oct 2023 11:02:38 -0700 Subject: [PATCH] chore: cargo-dist 0.4.0 --- .github/workflows/release.yml | 22 +++++++++++++++++----- Cargo.toml | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90181761..e7ce27e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,7 +58,7 @@ jobs: with: submodules: recursive - name: Install cargo-dist - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.1/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.4.0/cargo-dist-installer.sh | sh" - id: plan run: | cargo dist plan ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} --output-format=json > dist-manifest.json @@ -92,6 +92,7 @@ jobs: runs-on: ${{ matrix.runner }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json steps: - uses: actions/checkout@v4 with: @@ -99,10 +100,13 @@ jobs: - uses: swatinem/rust-cache@v2 - name: Install cargo-dist run: ${{ matrix.install_dist }} + - name: Install dependencies + run: | + ${{ matrix.packages_install }} - name: Build artifacts run: | # Actually do builds and make zips and whatnot - cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json ${{ matrix.dist_args }} > dist-manifest.json + cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json echo "cargo dist ran successfully" - id: cargo-dist name: Post-build @@ -115,11 +119,15 @@ jobs: echo "paths<> "$GITHUB_OUTPUT" jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" + + cp dist-manifest.json "$BUILD_MANIFEST_NAME" - name: "Upload artifacts" uses: actions/upload-artifact@v3 with: name: artifacts - path: ${{ steps.cargo-dist.outputs.paths }} + path: | + ${{ steps.cargo-dist.outputs.paths }} + ${{ env.BUILD_MANIFEST_NAME }} # Build and package all the platform-agnostic(ish) things upload-global-artifacts: @@ -132,7 +140,7 @@ jobs: with: submodules: recursive - name: Install cargo-dist - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.1/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.4.0/cargo-dist-installer.sh | sh" # Get all the local artifacts for the global tasks to use (for e.g. checksums) - name: Fetch local artifacts uses: actions/download-artifact@v3 @@ -200,7 +208,7 @@ jobs: done git push - # Create a Github Release with all the results once everything is done, + # Create a Github Release with all the results once everything is done publish-release: needs: [plan, should-publish] runs-on: ubuntu-latest @@ -215,6 +223,10 @@ jobs: with: name: artifacts path: artifacts + - name: Cleanup + run: | + # Remove the granular manifests + rm artifacts/*-dist-manifest.json - name: Create Release uses: ncipollo/release-action@v1 with: diff --git a/Cargo.toml b/Cargo.toml index 281ab4ea..817d042c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,7 @@ lto = "thin" # Config for 'cargo dist' [workspace.metadata.dist] # The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.3.1" +cargo-dist-version = "0.4.0" # CI backends to support ci = ["github"] # The installers to generate for each app