Skip to content

Upload CLI binaries #144

Upload CLI binaries

Upload CLI binaries #144

Workflow file for this run

name: Upload CLI binaries
on:
release:
types:
- released
env:
TAG: ${{ github.event.release.tag_name }} # had some issue using this directly on windows
jobs:
linux:
runs-on: ubuntu-20.04
strategy:
matrix:
target: [x86_64-unknown-linux-gnu]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@stable
with:
profile: minimal
toolchain: stable
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Node
uses: actions/setup-node@v4
with:
node-version: "16"
- id: "auth"
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: "Set up Cloud SDK"
uses: google-github-actions/setup-gcloud@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc-multilib # required to build for 32-bit arch
- name: Install aarch64-unknown-linux-gnu linker
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
run: sudo apt install -y gcc-aarch64-linux-gnu
- name: Install armv7-unknown-linux-gnueabihf linker
if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }}
run: sudo apt install -y gcc-arm-linux-gnueabihf
- name: Deploy
run: |
rustup target add ${{ matrix.target }}
# build and deploy CLI
cargo build -p tmc-langs-cli --release --target ${{ matrix.target }}
gsutil cp target/${{ matrix.target }}/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-${{ matrix.target }}-$TAG