-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflow to create release assets for different platforms (#50)
- Loading branch information
Showing
1 changed file
with
125 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,125 @@ | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CARGO_TERM_COLOR: always | ||
|
||
name: Create Release / Upload Assets | ||
|
||
jobs: | ||
windows: | ||
name: Build for Windows | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: cargo test --release | ||
|
||
- name: Build | ||
run: cargo build --release | ||
|
||
- name: "Move to outputs/ folder" | ||
run: | | ||
mkdir outputs | ||
cp target/release/*.exe outputs/rcat-${{github.ref_name}}-win.exe | ||
- name: Upload to temporary storage | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: output-artifact | ||
path: outputs | ||
|
||
linux: | ||
name: Build for Linux | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: cargo test --release | ||
|
||
- name: Build | ||
run: cargo build --release | ||
|
||
- name: Install cargo-deb | ||
run: cargo install cargo-deb | ||
|
||
- name: Create deb package | ||
run: cargo deb | ||
|
||
# Name of binary needed | ||
- name: "Move to outputs/ folder" | ||
run: | | ||
mkdir outputs | ||
cp target/release/rcat outputs/rcat-${{github.ref_name}}-linux-x86_64 | ||
cp target/debian/*.deb outputs/rcat-${{github.ref_name}}-linux-x86_64.deb | ||
- name: Upload to temporary storage | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: output-artifact | ||
path: outputs | ||
|
||
macos: | ||
name: Build for Mac | ||
runs-on: macos-11 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install ARM target | ||
run: rustup update && rustup target add aarch64-apple-darwin | ||
|
||
- name: Test | ||
run: cargo test --release | ||
|
||
- name: Build | ||
run: cargo build --release --target=aarch64-apple-darwin | ||
|
||
- name: Build | ||
run: cargo build --release | ||
|
||
# Name of binary needed | ||
- name: "Move to outputs/ folder" | ||
run: | | ||
mkdir outputs | ||
cp target/aarch64-apple-darwin/release/rcat outputs/rcat-${{github.ref_name}}-darwin-aarch64 | ||
cp target/release/rcat outputs/rcat-${{github.ref_name}}-darwin-x86_64 | ||
- name: Upload to temporary storage | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: output-artifact | ||
path: outputs | ||
|
||
release: | ||
name: Create/or release assets | ||
runs-on: ubuntu-latest | ||
needs: [windows, linux, macos] | ||
|
||
steps: | ||
- name: Download from temporary storage | ||
uses: actions/download-artifact@master | ||
with: | ||
name: output-artifact | ||
path: outputs | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v0.1.14 | ||
with: | ||
generate_release_notes: true | ||
# append_body: false | ||
# draft: false | ||
# prerelease: false | ||
files: | | ||
outputs/** |