-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (77 loc) · 2.63 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build
on: [push]
jobs:
notify_start:
runs-on: ubuntu-latest
steps:
- name: Build started notification
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "midihidi ${{ github.sha }} build started. [Progress.](https://github.com/eras/midihidi/actions/runs/${{github.run_id}})"
server: ${{ secrets.MATRIX_SERVER }}
build:
needs: notify_start
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install build deps
run: sudo apt-get install git libjack-dev
if: ${{ matrix.os == 'ubuntu-latest' }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: 'cargo build'
- uses: actions/upload-artifact@v2
with:
name: midihidi-${{ runner.os }}
path: |
target/debug/midihidi
Cargo.lock
if: ${{ matrix.os != 'windows-latest' }}
- uses: actions/upload-artifact@v2
with:
name: midihidi-${{ runner.os }}.exe
path: |
target/debug/midihidi.exe
Cargo.lock
if: ${{ matrix.os == 'windows-latest' }}
notify_end_success:
runs-on: ubuntu-latest
if: ${{ success() }}
needs: [notify_start, build]
steps:
- name: Build succeeded notification
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "midihidi ${{ github.sha }} build complete OK. [Logs.](https://github.com/eras/midihidi/actions/runs/${{github.run_id}})"
server: ${{ secrets.MATRIX_SERVER }}
notify_end_failed:
runs-on: ubuntu-latest
needs: [notify_start, build]
if: ${{ !success() }}
steps:
- name: Build failed notification
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "midihidi ${{ github.sha }} build failed. [Logs.](https://github.com/eras/midihidi/actions/runs/${{github.run_id}})"
server: ${{ secrets.MATRIX_SERVER }}