forked from pchpub/BiliRoaming-Rust-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (88 loc) · 2.54 KB
/
ci.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: ci
on:
push:
branches:
- '*'
tags:
- 'v*.*.*'
paths-ignore:
- '**.md'
- 'LICENSE'
- 'config.example.**'
- '**.sh'
- '**.json'
- '**.yml'
- '!.github/workflows/**'
jobs:
check:
name: Review the code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check
run: cargo check
build:
name: Build the binary file
if: ${{ github.event_name != 'pull_request' && success() }}
runs-on: ubuntu-latest
needs:
- check
steps:
- uses: actions/checkout@v3
- name: Build
run: |
docker run -i --rm \
-v $PWD:/workdir \
-v ~/.cargo/git:/root/.cargo/git \
-v ~/.cargo/registry:/root/.cargo/registry \
registry.gitlab.com/rust_musl_docker/image:stable-latest \
cargo build --profile=fast -vv --target=x86_64-unknown-linux-musl
- name: Upload Build Artifact
uses: actions/[email protected]
with:
name: biliroaming-rust-server-${{ github.run_number }}
path: |
./target/x86_64-unknown-linux-musl/fast/biliroaming_rust_server
alpha:
name: Upload the Alpha test version file
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: biliroaming-rust-server-${{ github.run_number }}
- name: Update Alpha Release
uses: mini-bomba/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
tag: alpha-releases
name: Alpha-Release
body: |
This automatic prerelease is built from commit ${{ env.GIT_HASH }} and was triggered by @${{ github.actor }}
[Github Actions workflow run that built this prerelease](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
Commit message:
${{ env.GIT_MESSAGE }}
files: |
./biliroaming_rust_server
clear_attachments: true
release:
name: Upload the binary file when it is released
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: biliroaming-rust-server-${{ github.run_number }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./biliroaming_rust_server