Skip to content
Open
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
55 changes: 55 additions & 0 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release binaries

on:
release:
types: [created]

permissions:
contents: read

jobs:
upload-cot-cli:
if: startsWith(github.event.release.tag_name, 'cot-cli-v')
name: Upload cot-cli (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
Comment on lines +17 to +29

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To increase portability of binaries, I'd choose to use ubuntu-22.04 for older glibc or compiling musl version (or both). What do you think @cot-rs/maintainers?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that the glibc baseline should be intentional. I have left this matrix unchanged for now because ubuntu-22.04 for the existing GNU targets, adding musl targets, and shipping both define different artifact sets. @cot-rs/maintainers, which of those should this PR adopt? I can update the matrix and cargo-binstall mapping once that choice is confirmed.

runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install cross
if: matrix.target == 'aarch64-unknown-linux-gnu'
uses: taiki-e/install-action@v2.85.4
with:
tool: cross

- name: Build and upload cot-cli
uses: taiki-e/upload-rust-binary-action@v1.30.2
with:
bin: cot
package: cot-cli
target: ${{ matrix.target }}
archive: cot-cli-$target
include: LICENSE-APACHE,LICENSE-MIT
checksum: sha256
locked: true
4 changes: 4 additions & 0 deletions cot-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ authors.workspace = true
name = "cot"
path = "src/main.rs"

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/{ name }-v{ version }/{ name }-{ target }{ archive-suffix }"
bin-dir = "{ bin }{ binary-ext }"

[lints]
workspace = true

Expand Down
Loading