-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
21796bb
commit 01bb121
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
|