diff --git a/.github/workflows/release_linux_arm.yaml b/.github/workflows/release_linux_arm.yaml new file mode 100644 index 0000000..2f9bafc --- /dev/null +++ b/.github/workflows/release_linux_arm.yaml @@ -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