-
Notifications
You must be signed in to change notification settings - Fork 6
78 lines (66 loc) · 1.75 KB
/
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Release
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
create-release:
name: "Create Release"
runs-on: "ubuntu-latest"
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
upload-release:
name: "Tagged Release"
needs: create-release
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
name: linux
bin: smaug
- os: macos-latest
name: mac
bin: smaug
- os: windows-latest
name: windows.exe
bin: smaug.exe
runs-on: ${{matrix.os }}
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy
- uses: actions/checkout@v2
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings
- name: Run tests
run: cargo test --verbose
- name: build
run: cargo build --release --locked
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: target/release/${{matrix.bin}}
asset_name: smaug-${{matrix.name}}
asset_content_type: application/octet-stream