-
Notifications
You must be signed in to change notification settings - Fork 3
170 lines (143 loc) · 4.82 KB
/
releases.yaml
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Releases
on:
push:
tags: ["*"]
jobs:
release-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.5.0
with:
access_token: ${{ github.token }}
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Build
run: cargo build --release
- name: Name Release
if: startsWith(github.ref, 'refs/tags/')
id: name_release
run: echo "RELEASE=helium-config-service-cli-${GITHUB_REF/refs\/tags\//}-x86-64-linux" >> $GITHUB_OUTPUT
- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/')
env:
NAME: ${{ steps.name_release.outputs.RELEASE }}
run: |
mkdir $NAME
mv target/release/helium-config-service-cli $NAME/
cp README.md $NAME/
cp LICENSE $NAME/
tar -zcvf $NAME.tar.gz $NAME/
sha256sum -b --tag $NAME.tar.gz > $NAME.checksum
- name: Push Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.name_release.outputs.RELEASE }}.tar.gz
${{ steps.name_release.outputs.RELEASE }}.checksum
env:
GITHUB_TOKEN: ${{ github.token }}
release-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-apple-darwin
default: true
override: true
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.5.0
with:
access_token: ${{ github.token }}
- name: Install protoc
run: brew install protobuf
- name: Build
run: cargo build --release
- name: Name Release
if: startsWith(github.ref, 'refs/tags/')
id: name_release
run: echo "RELEASE=helium-config-service-cli-${GITHUB_REF/refs\/tags\//}-x86-64-macos" >> $GITHUB_OUTPUT
- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/')
env:
NAME: ${{ steps.name_release.outputs.RELEASE }}
run: |
mkdir $NAME
mv target/release/helium-config-service-cli $NAME/
cp README.md $NAME/
cp LICENSE $NAME/
gtar -zcvf $NAME.tar.gz $NAME/
shasum -a 256 -b --tag $NAME.tar.gz > $NAME.checksum
- name: Push Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.name_release.outputs.RELEASE }}.tar.gz
${{ steps.name_release.outputs.RELEASE }}.checksum
env:
GITHUB_TOKEN: ${{ github.token }}
release-windows:
runs-on: windows-latest
steps:
- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/llvm
key: llvm-12.0
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "12.0"
directory: ${{ runner.temp }}/llvm
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-gnu
default: true
override: true
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.5.0
with:
access_token: ${{ github.token }}
- name: Install protoc
run: choco install protoc
- name: Build
run: cargo build --release
- name: Name Release
if: startsWith(github.ref, 'refs/tags/')
id: name_release
run: echo "RELEASE=helium-config-service-cli-${GITHUB_REF/refs\/tags\//}-x86-64-win" >> $GITHUB_OUTPUT
shell: bash
- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/')
env:
NAME: ${{ steps.name_release.outputs.RELEASE }}
run: |
mkdir $env:NAME
mv target/release/helium-config-service-cli.exe $env:NAME/
cp README.md $env:NAME/
cp LICENSE $env:NAME/
7z a "$env:NAME.zip" "$env:NAME/"
certUtil -hashfile "$env:NAME.zip" SHA256 > "$env:NAME.checksum"
- name: Push Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.name_release.outputs.RELEASE }}.zip
${{ steps.name_release.outputs.RELEASE }}.checksum
env:
GITHUB_TOKEN: ${{ github.token }}