Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nakabonne committed Mar 28, 2021
1 parent baca452 commit a7fca58
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
deploy:
# A strategy is used to define various build environments this job will run.
#
# To say it simple, this will create 3 separate independent jobs which will
# run on ubuntu, mac & windows.
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Build
run: cargo build --release

- name: Build for Mac
if: matrix.os == 'macos-latest'
run: |
strip target/release/rhack
mkdir -p release
tar -C ./target/release/ -czvf ./release/rhack-mac.tar.gz ./rhack
- name: Build for Linux
if: matrix.os == 'ubuntu-latest'
run: |
cargo install cargo-deb
cargo deb
strip target/release/rhack
mkdir -p release
mv target/debian/*.deb ./release/rhack-linux.deb
tar -C ./target/release/ -czvf ./release/rhack-linux.tar.gz ./rhack
- name: Build for Windows
if: matrix.os == 'windows-latest'
run: |
mkdir -p release
tar -C ./target/release/ -czvf ./release/rhack-win.tar.gz ./rhack.exe
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
files: |
./release/*.tar.gz
./release/*.zip
./release/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a7fca58

Please # to comment.