Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/release_linux_arm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and upload release (linux arm)

on:
release:
types: [created]

env:
APP_NAME: gdrive
ARCHIVE_NAME: gdrive_linux-arm64.tar.gz

jobs:
build:
runs-on: ubuntu-24.04-arm # Note: ubuntu-latest-arm does not exist.

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare upload url
run: |
UPLOAD_URL="$(jq -r '.release.upload_url' "$GITHUB_EVENT_PATH" | sed -e "s/{?name,label}$/?name=${ARCHIVE_NAME}/")"
echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_ENV

- name: Build application
run: |
docker run --rm -t -v $HOME/.cargo/registry/:/root/.cargo/registry -v "$(pwd)":/volume clux/muslrust:stable cargo build --release

- name: Create archive
run: |
tar -czf $ARCHIVE_NAME -C target/aarch64-unknown-linux-musl/release $APP_NAME

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ${{ env.ARCHIVE_NAME }}
asset_name: ${{ env.ARCHIVE_NAME }}
asset_content_type: application/gzip