diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5af1771..4b36e22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,6 +127,10 @@ jobs: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y echo "$HOME/.cargo/bin" >> $GITHUB_PATH fi + - uses: swatinem/rust-cache@v2 + with: + key: ${{ join(matrix.targets, '-') }} + cache-provider: ${{ matrix.cache_provider }} - name: Install dist run: ${{ matrix.install_dist.run }} # Get the dist-manifest diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..0fc04fa --- /dev/null +++ b/Justfile @@ -0,0 +1,38 @@ +# Test cargo-dist release build by creating a PR +dist-test-pr: + #!/usr/bin/env bash + set -euo pipefail + + # Checkout new branch + BRANCH_NAME="dist-test-$(date +%Y%m%d-%H%M%S)" + echo "Creating new branch: $BRANCH_NAME" + git checkout -b "$BRANCH_NAME" + + # Patch dist-workspace.toml to set pr-run-mode = "upload" + echo "Patching dist-workspace.toml..." + sed -i.bak 's/pr-run-mode = "plan"/pr-run-mode = "upload"/' dist-workspace.toml + rm -f dist-workspace.toml.bak + + # Run dist generate to generate updated workflow + echo "Running cargo dist generate..." + dist generate + + # Check if there are changes to commit + if ! git diff --quiet; then + echo "Committing changes..." + git add . + git commit -m "test: cargo-dist release artifact build" + + echo "Pushing branch and creating PR..." + git push -u origin "$BRANCH_NAME" + + gh pr create \ + --title "test: cargo-dist release artifact build" \ + --body "Test cargo-dist release build process" + + echo "PR created successfully!" + else + echo "No changes to commit. Cleaning up branch..." + git checkout - + git branch -D "$BRANCH_NAME" + fi diff --git a/dist-workspace.toml b/dist-workspace.toml index 98ba886..3d5fb40 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -12,7 +12,7 @@ installers = [] # Target platforms to build apps for (Rust target-triple syntax) targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "aarch64-pc-windows-msvc", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"] # Which actions to run on pull requests -pr-run-mode = "plan" +pr-run-mode = "upload" [dist.github-custom-runners] global = "ubuntu-22.04"