-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d347e32
commit 9e8cc99
Showing
1 changed file
with
111 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,111 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: ['v*'] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
default: true | ||
override: true | ||
components: clippy, rustfmt | ||
|
||
- name: Cancel previous runs | ||
uses: styfle/cancel-workflow-action@0.5.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Check formatting | ||
run: cargo fmt -- --check | ||
|
||
- name: Clippy | ||
uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: -- -Dclippy::all | ||
|
||
- name: Build | ||
run: cargo build --all --release | ||
|
||
- name: Name Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
id: name_release | ||
run: echo ::set-output name=RELEASE::lwr-$(echo $GITHUB_REF | cut -d / -f 3)-x86-64-linux | ||
|
||
- name: Prepare Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
NAME: ${{ steps.name_release.outputs.RELEASE }} | ||
run: | | ||
strip target/release/lwr | ||
mkdir $NAME | ||
mv target/release/lwr $NAME/ | ||
cp README.md $NAME/ | ||
cp LICENSE $NAME/ | ||
tar -zcvf $NAME.tar.gz $NAME/ | ||
- name: Push Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
${{ steps.name_release.outputs.RELEASE }}.tar.gz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-mac: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: x86_64-apple-darwin | ||
default: true | ||
override: true | ||
|
||
- name: Cancel previous runs | ||
uses: styfle/cancel-workflow-action@0.5.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Build | ||
run: cargo build --all --release | ||
|
||
- name: Name Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
id: name_release | ||
run: echo ::set-output name=RELEASE::lwr-$(echo $GITHUB_REF | cut -d / -f 3)-x86-64-macos | ||
|
||
- name: Prepare Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
NAME: ${{ steps.name_release.outputs.RELEASE }} | ||
run: | | ||
strip target/release/lwr | ||
mkdir $NAME | ||
mv target/release/lwr $NAME/ | ||
cp README.md $NAME/ | ||
cp LICENSE $NAME/ | ||
tar -zcvf $NAME.tar.gz $NAME/ | ||
- name: Push Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
${{ steps.name_release.outputs.RELEASE }}.tar.gz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|