From 16ea60640574ab03e22f2079ddae20287d1faf37 Mon Sep 17 00:00:00 2001 From: Boshen Date: Mon, 1 Apr 2024 00:17:13 +0800 Subject: [PATCH] ci: add release-binaries --- .github/workflows/release-binaries.yml | 60 ++++++++++++++++++++++++++ .github/workflows/release-plz.yml | 1 - 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-binaries.yml diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml new file mode 100644 index 0000000..918bb38 --- /dev/null +++ b/.github/workflows/release-binaries.yml @@ -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 }} diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index 9d9bbf7..4fbd18a 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -29,4 +29,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} -