-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (71 loc) · 2.31 KB
/
create_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
78
79
80
81
82
83
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Rust CI - Create Release
jobs:
check:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust latest stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Run cargo test
uses: actions-rs/cargo@v1
env:
ONET_CONFIG_FILENAME: .env.example
with:
command: test
- name: Run cargo build
uses: actions-rs/cargo@v1
env:
ONET_CONFIG_FILENAME: .env.example
with:
command: build
args: --release
- name: Generate SHA-256 hash file
run: |
cd ./target/release
sha256sum onet > onet.sha256
- name: Get Rustc version
id: get_rustc
run: echo ::set-output name=rustc::$(rustc -V)
- name: Get Tag version
id: get_tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_tag.outputs.tag }}
release_name: ONE-T ${{ steps.get_tag.outputs.tag }}
body: "Note: This release was built using `${{ steps.get_rustc.outputs.rustc }}`"
draft: true
prerelease: false
- name: Upload onet binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/onet
asset_name: onet
asset_content_type: application/octet-stream
- name: Upload onet sha256
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/onet.sha256
asset_name: onet.sha256
asset_content_type: text/plain