forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (53 loc) · 1.36 KB
/
test_build_release.yml
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
name: CI
# Only trigger, when the test workflow succeeded
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: cargo test
build:
needs: test
if: |
github.event_name == 'push' &&
github.event.base_ref == 'refs/heads/main' &&
startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Build torrust tracker
run: cargo build --release
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: torrust-tracker
path: ./target/release/torrust-tracker
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: torrust-tracker
- name: Release
uses: softprops/action-gh-release@v1
# with:
# files: |
# torrust-tracker