Skip to content

Commit

Permalink
ci: add release-binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Mar 31, 2024
1 parent 2604adf commit 16ea606
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release Binaries

on:
release:
types: [published]

defaults:
run:
shell: bash

permissions:
contents: write

jobs:
upload-assets:
name: ${{ matrix.target }}
if: github.repository_owner == 'oxc-project'
strategy:
matrix:
include:
- target: aarch64-unknown-linux-gnu
- target: aarch64-unknown-linux-musl
- target: aarch64-apple-darwin
os: macos-11
- target: aarch64-pc-windows-msvc
os: windows-2019
- target: x86_64-unknown-linux-gnu
- target: x86_64-unknown-linux-musl
- target: x86_64-apple-darwin
os: macos-11
- target: x86_64-pc-windows-msvc
os: windows-2019
- target: x86_64-unknown-freebsd
- target: universal-apple-darwin
os: macos-11
runs-on: ${{ matrix.os || 'ubuntu-20.04' }}
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1

- name: Install Rust
run: rustup update stable --no-self-update

- uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}

- run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >>"${GITHUB_ENV}"
if: contains(matrix.target, '-windows-msvc')

- run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static -C link-self-contained=yes" >>"${GITHUB_ENV}"
if: contains(matrix.target, '-linux-musl')

- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: cargo-release-oxc
target: ${{ matrix.target }}
tar: all
zip: windows
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 16ea606

Please sign in to comment.