-
Notifications
You must be signed in to change notification settings - Fork 1
184 lines (156 loc) · 5.5 KB
/
create-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
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Release
jobs:
build:
name: Build Sources
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build release binary
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features --release
- name: Copy binary
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p ./dist
cp target/release/wait-for-them dist/wait-for-them-linux
- name: Copy binary
if: matrix.os == 'windows-latest'
run: |
mkdir -p ./dist
cp target/release/wait-for-them.exe dist/wait-for-them-windows.exe
- name: Copy binary
if: matrix.os == 'macos-latest'
run: |
mkdir -p ./dist
cp target/release/wait-for-them dist/wait-for-them-macos
- name: Build release binary (minimal)
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Copy binary (minimal)
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p ./dist
cp target/release/wait-for-them dist/wait-for-them-linux-minimal
- name: Copy binary (minimal)
if: matrix.os == 'windows-latest'
run: |
cp target/release/wait-for-them.exe dist/wait-for-them-windows-minimal.exe
- name: Copy binary (minimal)
if: matrix.os == 'macos-latest'
run: |
mkdir -p ./dist
cp target/release/wait-for-them dist/wait-for-them-macos-minimal
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}
path: ./dist
release:
name: Create Release
runs-on: ubuntu-latest
needs: ['build']
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Download artifacts ubuntu
uses: actions/download-artifact@v1
with:
name: ubuntu-latest
path: dist
- name: Download artifacts windows
uses: actions/download-artifact@v1
with:
name: windows-latest
path: dist
- name: Download artifacts macos
uses: actions/download-artifact@v1
with:
name: macos-latest
path: dist
- name: Get description
run: echo "##[set-output name=tag_description;]$(git tag -l --format='%(contents:body)' ${{ github.ref }})"
id: get_description
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: "${{ steps.get_description.outputs.description }}"
draft: false
prerelease: false
- name: Upload Release Asset ubuntu
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/wait-for-them-linux
asset_name: wait-for-them-linux
asset_content_type: application/bin
- name: Upload Release Asset ubuntu (minimal)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/wait-for-them-linux-minimal
asset_name: wait-for-them-linux-minimal
asset_content_type: application/bin
- name: Upload Release Asset windows
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/wait-for-them-windows.exe
asset_name: wait-for-them-windows.exe
asset_content_type: application/bin
- name: Upload Release Asset windows (minimal)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/wait-for-them-windows-minimal.exe
asset_name: wait-for-them-windows-minimal.exe
asset_content_type: application/bin
- name: Upload Release Asset macos
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/wait-for-them-macos
asset_name: wait-for-them-macos
asset_content_type: application/bin
- name: Upload Release Asset macos (minimal)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/wait-for-them-macos-minimal
asset_name: wait-for-them-macos-minimal
asset_content_type: application/bin