-
Notifications
You must be signed in to change notification settings - Fork 7
75 lines (70 loc) · 2.33 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
name: Build and release binaries
on:
release:
types: [published]
workflow_dispatch:
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset_name: bigtools-linux-gnu-noremote
remote: false
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset_name: bigtools-linux-gnu
remote: true
- os: windows-latest
target: x86_64-pc-windows-msvc
asset_name: bigtools-windows-msvc
remote: true
- os: macos-latest
target: x86_64-apple-darwin
asset_name: bigtools-apple-darwin
remote: true
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Build project
run: |
rustup target add ${{ matrix.target }}
cargo build -p bigtools --release --locked -Z unstable-options --out-dir release --no-default-features --features cli ${{ matrix.remote && '--features remote' || '' }} --target ${{ matrix.target }}
- name: Archive Release
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: ${{ github.workspace }}/${{ matrix.asset_name }}.zip
exclusions: '*.git* /*node_modules/* .editorconfig'
path: release/
- name: Zip upload
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.workspace }}/${{ matrix.asset_name }}.zip
publish:
if: startsWith(github.ref, 'refs/tags/v')
name: Publish
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Cargo publish
run: cargo publish -p bigtools --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --features cli --features remote
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}