-
Notifications
You must be signed in to change notification settings - Fork 0
256 lines (255 loc) · 9.8 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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# largely copy-pasted from https://github.com/ebbflow-io/ebbflow/blob/0f1bfc988bedba7dee93e90e523cdacf1fb13ccb/.github/workflows/continuous-integration.yml
name: Release
# trigger using GH web ui / CLI
on: workflow_dispatch
jobs:
quickcheck:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.rustversion.outputs.rustversion }}
steps:
- uses: actions/checkout@v2
- run: cargo check
- run: cargo pkgid
- run: 'echo "$(cargo pkgid | cut -d# -f2)"'
- id: rustversion
run: 'echo "::set-output name=rustversion::$(cargo pkgid | cut -d# -f2)"'
build:
needs: quickcheck
name: 'build-${{matrix.os}}'
runs-on: ${{ matrix.os }}
strategy:
matrix:
#os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build
- name: Run tests
run: cargo test
# fedorarpmbuild:
# needs: [build]
# runs-on: ubuntu-latest
# name: FedoraRpm
# steps:
# - uses: actions/checkout@v2
# - name: BuildRpm
# id: buildrpm
# uses: ebbflow-io/[email protected]
# - name: Upload RPM Artifact
# uses: actions/upload-artifact@v2
# with:
# name: fedorarpm
# path: ./target/x86_64-unknown-linux-musl/release/rpmbuild/RPMS/x86_64/*
# opensuseleaprpmbuild:
# needs: [build]
# runs-on: ubuntu-latest
# name: OpensuseLeapRpm
# steps:
# - uses: actions/checkout@v2
# - name: BuildRpm
# id: buildrpm
# uses: ebbflow-io/[email protected]
# - name: Upload RPM Artifact
# uses: actions/upload-artifact@v2
# with:
# name: opensuserpm
# path: ./target/x86_64-unknown-linux-musl/release/rpmbuild/RPMS/x86_64/*
debbuild:
needs: [build]
runs-on: ubuntu-latest
name: Amd64Deb
steps:
- uses: actions/checkout@v2
- name: BuildDeb
id: debbuild
uses: ebbflow-io/[email protected]
- name: Upload Deb Artifact
uses: actions/upload-artifact@v2
with:
name: amd64deb
path: ./target/x86_64-unknown-linux-musl/debian/*
raspbianbuild:
needs: [build]
runs-on: ubuntu-latest
name: Armv7Deb
steps:
- uses: actions/checkout@v2
- name: BuildDeb
id: debbuild
uses: ebbflow-io/[email protected]
- name: Upload Deb Artifact
uses: actions/upload-artifact@v2
with:
name: armv7deb
path: ./target/armv7-unknown-linux-musleabihf/debian/*
# windowsbuild:
# needs: [build]
# runs-on: windows-latest
# env:
# RUSTFLAGS: '-C target-feature=+crt-static'
# name: Windows
# steps:
# - uses: actions/checkout@v2
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# - uses: actions-rs/[email protected]
# with:
# crate: cargo-wix
# version: latest
# - run: cargo wix -v --nocapture -o .
# - name: Upload MSI Artifact
# uses: actions/upload-artifact@v2
# with:
# name: windows
# path: ./*.msi
# macosbuild:
# needs: [build, quickcheck]
# runs-on: macos-latest
# name: MacOS
# steps:
# - uses: actions/checkout@v2
# - name: Build
# run: cargo build --release
# - name: Zip up macos binaries
# run: 'zip -j forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_macos.zip ./target/release/forward-as-attachment-mta'
# - name: Upload Zipped Artifact
# uses: actions/upload-artifact@v2
# with:
# name: macos
# path: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_macos.zip'
# - name: Upload Bin Artifact
# uses: actions/upload-artifact@v2
# with:
# name: macos
# path: ./target/release/forward-as-attachment-mta
# - name: Upload Daemon Artifact
# uses: actions/upload-artifact@v2
# with:
# name: macos
# path: ./target/release/forward-as-attachment-mta
amd64binaries:
needs: [build, quickcheck]
runs-on: ubuntu-latest
name: Amd64StaticBinaries
steps:
- uses: actions/checkout@v2
- name: StaticBinaryBuild
id: amd64staticbuild
uses: ebbflow-io/[email protected]
with:
cmd: cargo build --release --target=x86_64-unknown-linux-musl
- name: Upload Daemon Artifact
uses: actions/upload-artifact@v2
with:
name: amd64binaries
path: ./target/x86_64-unknown-linux-musl/release/forward-as-attachment-mta
arm7binaries:
needs: [build, quickcheck]
runs-on: ubuntu-latest
name: Armv7StaticBinaries
steps:
- uses: actions/checkout@v2
- name: StaticBinaryBuild
id: armv7statibuild
uses: ebbflow-io/[email protected]
with:
cmd: cargo build --release --target=armv7-unknown-linux-musleabihf
- name: Upload Daemon Artifact
uses: actions/upload-artifact@v2
with:
name: armv7binaries
path: ./target/armv7-unknown-linux-musleabihf/release/forward-as-attachment-mta
update_release_draft:
#needs: [quickcheck, arm7binaries, amd64binaries, macosbuild, windowsbuild, raspbianbuild, debbuild, opensuseleaprpmbuild, fedorarpmbuild]
needs: [quickcheck, arm7binaries, amd64binaries, raspbianbuild, debbuild]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: '${{ needs.quickcheck.outputs.version }}'
release_name: Release ${{ needs.quickcheck.outputs.version }}
body: 'Change Me'
draft: true
prerelease: false
- uses: actions/download-artifact@v2
- run: ls -lha
- name: Upload amd64 deb Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./amd64deb/forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_amd64.deb
asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_amd64.deb'
asset_content_type: application/vnd.debian.binary-package
- name: Upload armv7 deb Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./armv7deb/forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_armhf.deb
asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_armhf.deb'
asset_content_type: application/vnd.debian.binary-package
# - name: Upload amd64 rpm fedora Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./fedorarpm/forward-as-attachment-mta-${{needs.quickcheck.outputs.version}}-1.x86_64.rpm
# asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}-1_amd64_fedora.rpm'
# asset_content_type: application/octet-stream
# - name: Upload amd64 rpm opensuse Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./opensuserpm/forward-as-attachment-mta-${{needs.quickcheck.outputs.version}}-1.x86_64.rpm
# asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}-1_amd64_opensuseleap.rpm'
# asset_content_type: application/octet-stream
# - name: Upload Windows Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./windows/forward-as-attachment-mta-${{needs.quickcheck.outputs.version}}-x86_64.msi
# asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}.msi'
# asset_content_type: application/octet-stream
# - name: Upload Macos Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./macos/forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_macos.zip
# asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_macos.zip'
# asset_content_type: application/zip
- name: Upload Armv7 Static Binary Zip Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./armv7binaries/forward-as-attachmenta-mta
asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_linux_armv7'
asset_content_type: application/octet-stream
- name: Upload Amd64 Static Binary Zip Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./amd64binaries/forward-as-attachment-mta
asset_name: 'forward-as-attachment-mta_${{needs.quickcheck.outputs.version}}_linux_amd64'
asset_content_type: application/octet-stream