Skip to content

Commit

Permalink
Create release.yml, addresses #10
Browse files Browse the repository at this point in the history
This is a base GitHub Action that builds a number of binaries and adds them to a draft release. I'm not sure if it's correct, which is why I'm putting it in as a PR for review.
  • Loading branch information
Isaac Clayton committed Dec 12, 2020
1 parent 21796bb commit 01bb121
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build Release

on:
push:
tags:
- 'v*'

jobs:

build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- aarch64-apple-darwin
- x86_64-apple-darwin

steps:
- name: Checkout Passerine
- uses: actions/checkout@v2
with:
path: passerine

- name: Checkout Aspen
- uses: actions/checkout@v2
with:
repository: vrtbl/aspen
path: aspen

- name: Get Toolchain
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Cross-Compile
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --manifest-path $GITHUB_WORKSPACE/aspen/Cargo.toml --target=${{ matrix.target }}

- name: Move Binary
- run: mv $GITHUB_WORKSPACE/aspen/target/release/aspen $GITHUB_WORKSPACE/bin/aspen_${{ matrix.target }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: true

- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: $GITHUB_WORKSPACE/bin/aspen_${{ matrix.target }}
asset_name: aspen_${{ matrix.target }}

0 comments on commit 01bb121

Please sign in to comment.