Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: also install cargo-dist on build-local #2683

Merged
merged 21 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
74 changes: 71 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: cargo-dist-cache
path: ~/.cargo/bin/dist
# TODO: revert after switching back to released dist
path: ~/.cargo-install/cargo-dist/bin/dist
# sure would be cool if github gave us proper conditionals...
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
# functionality based on whether this is a pull_request, and whether it's from a fork.
Expand Down Expand Up @@ -134,8 +135,13 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dist
run: ${{ matrix.install_dist }}
# Install fork of dist to allow for binaries in the root of the tarball
- name: Install cargo-dist from git
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-dist
git: https://github.com/ruben-arts/cargo-dist
branch: feature/allow_binaries_in_root_of_tar
# Get the dist-manifest
- name: Fetch local artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -262,6 +268,68 @@ jobs:
name: artifacts-dist-manifest
path: dist-manifest.json

# Unpack binaries, required for setup-pixi
- name: Unpack binaries tar
run: |
mkdir -p unpacked-artifacts
for artifact in target/distrib/*.tar.gz; do
echo artifact: $artifact
# Extract the base name without the extension
base_name=$(basename "$artifact" .tar.gz)

# Extract the artifact contents
tar -xvf "$artifact" pixi > unpacked-artifacts/$base_name
chmod +x unpacked-artifacts/$base_name
done
- name: Unpack binaries zip
run: |
for artifact in target/distrib/*.zip; do
echo artifact: $artifact
# Extract the base name without the extension
base_name=$(basename "$artifact" .zip)

# Extract the artifact contents
# Because zip is only used on windows we can assume the binary is an exe
unzip -p "$artifact" pixi > unpacked-artifacts/$base_name.exe
done

# Upload unpacked artifacts, not sure how to do this in one go as you have to name the artifact
- name: Upload unpacked artifact for pixi-aarch64-unknown-linux-musl
uses: actions/upload-artifact@v4
with:
name: artifacts-pixi-aarch64-unknown-linux-musl
path: unpacked-artifacts/pixi-aarch64-unknown-linux-musl

- name: Upload unpacked artifact for pixi-x86_64-unknown-linux-musl
uses: actions/upload-artifact@v4
with:
name: artifacts-pixi-x86_64-unknown-linux-musl
path: unpacked-artifacts/pixi-x86_64-unknown-linux-musl

- name: Upload unpacked artifact for pixi-aarch64-apple-darwin
uses: actions/upload-artifact@v4
with:
name: artifacts-pixi-aarch64-apple-darwin
path: unpacked-artifacts/pixi-aarch64-apple-darwin

- name: Upload unpacked artifact for pixi-x86_64-apple-darwin
uses: actions/upload-artifact@v4
with:
name: artifacts-pixi-x86_64-apple-darwin
path: unpacked-artifacts/pixi-x86_64-apple-darwin

- name: Upload unpacked artifact for pixi-x86_64-pc-windows-msvc.exe
uses: actions/upload-artifact@v4
with:
name: artifacts-pixi-x86_64-pc-windows-msvc.exe
path: unpacked-artifacts/pixi-x86_64-pc-windows-msvc.exe

- name: Upload unpacked artifact for pixi-aarch64-pc-windows-msvc.exe
uses: actions/upload-artifact@v4
with:
name: artifacts-pixi-aarch64-pc-windows-msvc.exe
path: unpacked-artifacts/pixi-aarch64-pc-windows-msvc.exe

# Create a GitHub Release while uploading all files to it
announce:
needs:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ license.workspace = true
name = "pixi"
readme.workspace = true
repository.workspace = true
version = "0.39.1"
version = "0.39.2-rc0"

[features]
default = ["rustls-tls"]
Expand Down Expand Up @@ -362,7 +362,7 @@ tokio = { workspace = true, features = ["rt"] }
# Config for 'dist'
[workspace.metadata.dist]
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.26.0-prerelease.3"
cargo-dist-version = "0.25.1"
nichmor marked this conversation as resolved.
Show resolved Hide resolved
# CI backends to support
ci = "github"
# The installers to generate for each app
Expand Down
Loading