-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (175 loc) · 6.27 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
# Build a set of release binaries when we tag a new version.
on: [push, pull_request]
name: Release-candidate binaries
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)"'
debbuild:
needs: [quickcheck]
runs-on: ubuntu-latest
name: Amd64Deb
steps:
- uses: actions/checkout@v2
- name: BuildDeb
id: debbuild
uses: jamesmcm/cargo-deb-amd64-ubuntu@c53cd3b268e8adef6d9569f0323f28ba8d734b72
- name: Upload Deb Artifact
uses: actions/upload-artifact@v2
with:
name: amd64deb
path: ./target/x86_64-unknown-linux-musl/debian/*
raspbianbuild:
needs: [quickcheck]
runs-on: ubuntu-latest
name: Armv7Deb
steps:
- uses: actions/checkout@v2
- name: BuildDeb
id: debbuild
uses: jamesmcm/cargo-deb-armv7-debian@789dd9aebbb37811132cface858bdb03a19227ef
- name: Upload Deb Artifact
uses: actions/upload-artifact@v2
with:
name: armv7deb
path: ./target/armv7-unknown-linux-musleabihf/debian/*
windowsbuild:
needs: [quickcheck]
runs-on: windows-latest
env:
RUSTFLAGS: '-C target-feature=+crt-static'
name: Windows
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --release
- name: Upload Bin Artifact
uses: actions/upload-artifact@v2
with:
name: windows
path: ./target/release/hashmash.exe
macosbuild:
needs: [quickcheck]
runs-on: macos-latest
name: MacOS
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --release
- name: Upload Bin Artifact
uses: actions/upload-artifact@v2
with:
name: macos
path: ./target/release/hashmash
amd64binary:
needs: [quickcheck]
runs-on: ubuntu-latest
name: Amd64StaticBinary
steps:
- uses: actions/checkout@v2
- name: StaticBinaryBuild
id: amd64staticbuild
uses: jamesmcm/cargo-deb-amd64-ubuntu@c53cd3b268e8adef6d9569f0323f28ba8d734b72
with:
cmd: cargo build --release --target=x86_64-unknown-linux-musl
- name: Upload Bin Artifact
uses: actions/upload-artifact@v2
with:
name: amd64binary
path: ./target/x86_64-unknown-linux-musl/release/hashmash
arm7binary:
needs: [quickcheck]
runs-on: ubuntu-latest
name: Armv7StaticBinary
steps:
- uses: actions/checkout@v2
- name: StaticBinaryBuild
id: armv7statibuild
uses: jamesmcm/cargo-deb-armv7-debian@789dd9aebbb37811132cface858bdb03a19227ef
with:
cmd: cargo build --release --target=armv7-unknown-linux-musleabihf
- name: Upload Bin Artifact
uses: actions/upload-artifact@v2
with:
name: armv7binary
path: ./target/armv7-unknown-linux-musleabihf/release/hashmash
update_release_draft:
needs: [quickcheck, arm7binary, amd64binary, macosbuild, windowsbuild, 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 }}
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/hashmash_${{needs.quickcheck.outputs.version}}_amd64.deb
asset_name: 'hashmash_${{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/hashmash_${{needs.quickcheck.outputs.version}}_armhf.deb
asset_name: 'hashmash_${{needs.quickcheck.outputs.version}}_armhf.deb'
asset_content_type: application/vnd.debian.binary-package
- 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/hashmash.exe
asset_name: 'hashmash_${{needs.quickcheck.outputs.version}}_windows.exe'
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/hashmash
asset_name: 'hashmash_${{needs.quickcheck.outputs.version}}_macos_intel'
asset_content_type: application/octet-stream
- 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: ./armv7binary/hashmash
asset_name: 'hashmash_${{needs.quickcheck.outputs.version}}_linux_armv7_binary'
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: ./amd64binary/hashmash
asset_name: 'hashmash_${{needs.quickcheck.outputs.version}}_linux_x86-64_binary'
asset_content_type: application/octet-stream