Fix CI on master #1195
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build SpacetimeDB CLI | |
on: | |
push: | |
tags: | |
- '**' | |
branches: | |
- master | |
- release/* | |
- noa/fix-master-ci | |
jobs: | |
build-cli: | |
strategy: | |
matrix: | |
include: | |
- { target: x86_64-unknown-linux-gnu, runner: bare-metal } | |
- { target: aarch64-unknown-linux-gnu, runner: arm-runner } | |
- { target: aarch64-apple-darwin, runner: macos-latest } | |
- { target: x86_64-apple-darwin, runner: macos-latest } | |
- { target: x86_64-pc-windows-msvc, runner: windows-latest } | |
name: Build CLI for ${{ matrix.target }} | |
runs-on: ${{ matrix.runner }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Show arch | |
run: uname -a | |
- name: Install Rust | |
uses: dsherret/rust-toolchain-file@v1 | |
- name: Install rust target | |
run: rustup target add ${{ matrix.target }} | |
- name: Compile | |
run: | | |
cargo build --release --target ${{ matrix.target }} -p spacetimedb-cli -p spacetimedb-standalone -p spacetimedb-update | |
- name: Package (unix) | |
if: ${{ runner.os != 'Windows' }} | |
run: | | |
mkdir build | |
cd target/${{matrix.target}}/release | |
tar -czf ../../../build/spacetime-${{matrix.target}}.tar.gz spacetimedb-{cli,standalone,update} | |
- name: Package (windows) | |
if: ${{ runner.os == 'Windows' }} | |
run: | | |
mkdir build | |
cd target/${{matrix.target}}/release | |
7z a ../../../build/spacetime-${{matrix.target}}.zip spacetimedb-{cli,standalone,update}.exe | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Upload to DO Spaces | |
uses: shallwefootball/s3-upload-action@master | |
with: | |
aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
aws_bucket: ${{ vars.AWS_BUCKET }} | |
source_dir: build | |
endpoint: https://nyc3.digitaloceanspaces.com | |
destination_dir: ${{ steps.extract_branch.outputs.branch }} |