Skip to content

Commit

Permalink
Add workflow for building macos release
Browse files Browse the repository at this point in the history
  • Loading branch information
prasmussen committed Aug 25, 2022
1 parent 9e83edd commit 98efb15
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release_macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and upload release (macos)

on:
release:
types: [created]

env:
APP_NAME: poly
ARCHIVE_NAME: poly_macos-x64.tar.gz

jobs:
build:
runs-on: macos-latest

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

- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true

- 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

0 comments on commit 98efb15

Please sign in to comment.