-
Notifications
You must be signed in to change notification settings - Fork 290
144 lines (125 loc) · 4.5 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Release asset bot
on:
workflow_dispatch:
release:
types: [published]
jobs:
build-on-github:
name: Build release asset
continue-on-error: true
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
- ubuntu-20.04
- macos-latest
- windows-latest
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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: Install LLVM and Clang for Ubuntu22.04
uses: egor-tensin/setup-clang@v1
if: matrix.platform == 'ubuntu-22.04'
with:
platform: x64
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: build for ${{ matrix.platform }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: build starcoin release asset
run: bash ./scripts/release.sh ${{ matrix.platform }}
- name: build mpm release asset
run: bash ./scripts/release_mpm.sh ${{ matrix.platform }}
- name: upload artifact asset
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release'}}
with:
name: starcoin-${{ matrix.platform }}.zip
path: ./starcoin-${{ matrix.platform }}.zip
- name: upload starcoin 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 mpm release asset
if: ${{ github.event_name == 'release'}}
id: upload-mpm-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./mpm-${{ matrix.platform }}.zip
asset_name: mpm-${{ matrix.platform }}.zip
asset_content_type: application/zip
build-on-selfhosted:
name: Build release asset with selfhosted
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: build for ubuntu-18.04
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: build starcoin release asset
run: bash ./scripts/release.sh 'ubuntu-18.04'
- name: build mpm release asset
run: bash ./scripts/release_mpm.sh 'ubuntu-18.04'
- name: upload artifact asset
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release'}}
with:
name: starcoin-ubuntu-18.04.zip
path: ./starcoin-ubuntu-18.04.zip
- name: upload starcoin 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-ubuntu-18.04.zip
asset_name: starcoin-ubuntu-18.04.zip
asset_content_type: application/zip
- name: upload mpm release asset
if: ${{ github.event_name == 'release'}}
id: upload-mpm-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./mpm-ubuntu-18.04.zip
asset_name: mpm-ubuntu-18.04.zip
asset_content_type: application/zip