-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (76 loc) · 2.77 KB
/
release_asset.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
name: Release asset bot
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
name: Build release asset
continue-on-error: true
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
- ubuntu-18.04
- macos-latest
- windows-latest
runs-on: ${{matrix.platform}}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: install rust toolchain
uses: actions-rs/toolchain@v1
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
uses: KyleMayes/install-llvm-action@v1
if: matrix.platform == 'windows-latest'
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.platform == 'windows-latest'
- name: build for ${{ matrix.platform }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: build release asset
run: bash ./scripts/release.sh ${{ matrix.platform }}
- name: upload artifact asset
uses: actions/upload-artifact@v2
if: ${{ github.event_name != 'release'}}
with:
name: starcoin-${{ matrix.platform }}.zip
path: ./starcoin-${{ matrix.platform }}.zip
- name: upload release asset
if: ${{ github.event_name == 'release'}}
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./starcoin-${{ matrix.platform }}.zip
asset_name: starcoin-${{ matrix.platform }}.zip
asset_content_type: application/zip
- name: upload move-cli release asset
if: ${{ github.event_name == 'release'}}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./target/release/move
asset_name: move-${{ matrix.platform }}
asset_content_type: application/octet-stream
- name: upload genesis-nft release asset
if: ${{ github.event_name == 'release'}}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./target/release/genesis-nft-miner
asset_name: genesis-nft-miner-${{ matrix.platform }}
asset_content_type: application/octet-stream