-
Notifications
You must be signed in to change notification settings - Fork 28
46 lines (38 loc) · 1.12 KB
/
build.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
name: Build
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build Code
run: cargo build --verbose
- name: Test Code
run: cargo test --verbose
- name: Get Branch Name
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
id: branch_name
run: |
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: Create Release
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
draft: false
prerelease: false