Skip to content

Commit

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

on:
release:
types: [created]

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

jobs:
build:
runs-on: ubuntu-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 aa6ce5d

Please sign in to comment.