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

Enable more release targets #325

Merged
merged 16 commits into from
Mar 18, 2022
47 changes: 39 additions & 8 deletions .github/workflows/server-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,52 @@ on:
jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
archive: zip
os: windows-latest

- target: x86_64-unknown-linux-musl
archive: tar.gz tar.xz
os: ubuntu-latest

- target: x86_64-apple-darwin
os: macos-latest

- target: aarch64-apple-darwin
os: macos-latest
steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/rust-build.action@latest

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
target: ${{ matrix.target }}

- name: Install musl for x86_64-unknown-linux-musl
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
run: sudo apt-get install -y musl-dev musl-tools

- name: Compile server
uses: actions-rs/cargo@v1
with:
command: build
args: --target ${{ matrix.target }} --release --manifest-path server/svix-server/Cargo.toml

- name: Set environment variables for aarch64 MacOS
if: ${{ matrix.target == 'aarch64-apple-darwin' }}
run: echo SDKROOT="$(xcrun -sdk macosx11.1 --show-sdk-path)" >> "$GITHUB_ENV" && \
echo MACOSX_DEPLOYMENT_TARGET="$(xcrun -sdk macosx11.1 --show-sdk-platform-version)" >> "$GITHUB_ENV"

- name: Release
uses: actions/upload-artifact@v3
with:
name: svix-server-${{ matrix.target }}
path: server/target/release/svix-server*
env:
SRC_DIR: server/svix-server
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}