Skip to content

Build and upload release (macos) #27

Build and upload release (macos)

Build and upload release (macos) #27

Workflow file for this run

name: Build and upload release (macos)
on:
release:
types: [created]
env:
APP_NAME: gdrive
ARCHIVE_NAME: gdrive_macos-x64.tar.gz
jobs:
build:
runs-on: macos-latest
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: |
cargo build --release
tar -czf $ARCHIVE_NAME -C target/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