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

Publish CLI binaries for cargo-binstall #1358

Merged
merged 27 commits into from
Aug 15, 2023
Merged
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
54 changes: 54 additions & 0 deletions .github/workflows/cli_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build CLI for Release

# Will run automatically on every new release
on:
release:
types: [published]

jobs:
build-and-upload:
permissions:
contents: write
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- {
target: x86_64-pc-windows-msvc,
os: windows-latest,
toolchain: "1.70.0",
}
- {
target: x86_64-apple-darwin,
os: macos-latest,
toolchain: "1.70.0",
}
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-latest,
toolchain: "1.70.0",
}
steps:
- uses: actions/checkout@v3
- name: Install stable
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.platform.toolchain }}
targets: ${{ matrix.platform.target }}

# Setup the Github Actions Cache for the CLI package
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
workspaces: packages/cli -> ../../target

# This neat action can build and upload the binary in one go!
- name: Build and upload binary
uses: taiki-e/upload-rust-binary-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
target: ${{ matrix.platform.target }}
bin: dx
archive: dx-${{ matrix.platform.target }}
checksum: sha256
manifest_path: packages/cli/Cargo.toml
6 changes: 6 additions & 0 deletions packages/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@ name = "dx"

[dev-dependencies]
tempfile = "3.3"

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/dx-{ target }{ archive-suffix }"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"