Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 38 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down