-
-
Notifications
You must be signed in to change notification settings - Fork 72
260 lines (250 loc) · 8.09 KB
/
cd.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
257
258
259
260
name: CD
on:
push:
branches:
- main
tags:
- v*
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macOS-latest
target: x86_64-apple-darwin
rust_flags: ""
features: ""
binary_postfix: ""
upx_args: --best
strip: true
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
rust_flags: ""
features: ""
binary_postfix: ""
upx_args: --best --lzma
strip: true
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
rust_flags: ""
features: ""
binary: "taskwarrior-tui-x86_64-unknown-linux-musl"
upx_args: --best --lzma
strip: true
- os: windows-latest
target: x86_64-pc-windows-gnu
rust_flags: -C target-feature=+crt-static
features: ""
binary_postfix: ".exe"
upx_args: -9
strip: false
- os: windows-latest
target: x86_64-pc-windows-msvc
rust_flags: -C target-feature=+crt-static
features: ""
binary_postfix: ".exe"
upx_args: -9
strip: false
- os: windows-latest
target: i686-pc-windows-msvc
rust_flags: -C target-feature=+crt-static
features: ""
binary_postfix: ".exe"
upx_args: -9
strip: false
env:
RUSTFLAGS: ${{ matrix.rust_flags }}
MACOSX_DEPLOYMENT_TARGET: 10.7
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
default: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release ${{matrix.features}} --target=${{ matrix.target }}
# - name: Compress binaries
# uses: svenstaro/upx-action@v2
# with:
# files: |
# target/${{ matrix.target }}/release/taskwarrior-tui${{ matrix.binary_postfix }}
# args: ${{ matrix.upx_args }}
# strip: ${{ matrix.strip }}
- name: Packaging binary
shell: bash
run: |
cd target/${{ matrix.target }}/release
tar czvf taskwarrior-tui-${{ matrix.target }}.tar.gz taskwarrior-tui${{ matrix.binary_postfix }}
if [[ ${{ runner.os }} == 'Windows' ]]; then
certutil -hashfile taskwarrior-tui-${{ matrix.target }}.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > taskwarrior-tui-${{ matrix.target }}.sha256
else
shasum -a 256 taskwarrior-tui-${{ matrix.target }}.tar.gz > taskwarrior-tui-${{ matrix.target }}.sha256
fi
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: taskwarrior-tui
path: target/${{ matrix.target }}/release/taskwarrior-tui-${{ matrix.target }}.tar.gz
- name: Releasing assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.target }}/release/taskwarrior-tui-${{ matrix.target }}.tar.gz
target/${{ matrix.target }}/release/taskwarrior-tui-${{ matrix.target }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
homebrew:
name: Bump Homebrew formula
runs-on: macos-latest
steps:
- name: Update Homebrew formula
if: startsWith(github.ref, 'refs/tags/')
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{secrets.HOMEBREW_TOKEN}}
formula: taskwarrior-tui
deb:
name: Publish deb package
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Install cargo-deb
run: cargo install cargo-deb
- name: Build deb package
run: cargo deb -p taskwarrior-tui -o target/debian/taskwarrior-tui.deb
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: taskwarrior-tui
path: target/debian/taskwarrior-tui.deb
- name: Releasing assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
target/debian/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
rpm:
name: Publish rpm package
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Install rpm
run: sudo apt-get install rpm
- name: Install cargo-rpm
run: cargo install cargo-rpm
- name: Build rpm package
run: cargo rpm build
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: taskwarrior-tui
path: target/release/rpmbuild/RPMS/x86_64/taskwarrior-tui-*.x86_64.rpm
- name: Releasing assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
target/release/rpmbuild/RPMS/x86_64/taskwarrior-tui-*.x86_64.rpm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
aur:
name: Publish aur package
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Install cargo-aur
run: cargo install cargo-aur
- name: Build aur package
run: cargo aur
grcov:
runs-on: ubuntu-latest
env:
TASKRC: taskwarrior-testdata/.taskrc
TASKDATA: taskwarrior-testdata/.task
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
- run: sudo apt-get update
- name: Compile taskwarrior
run: |
cd /tmp
git clone https://github.com/GothenburgBitFactory/taskwarrior
cd taskwarrior
git checkout v3.0.0
cmake -DCMAKE_BUILD_TYPE=release -DENABLE_SYNC=OFF .
make
sudo make install
- run: |
task --version
- uses: actions/checkout@v2
with:
repository: kdheepak/taskwarrior-testdata
path: taskwarrior-testdata
- run: |
# prepare taskwarrior, initial setup
task rc.confirmation=off || echo 0
- name: Execute tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
# Note that `actions-rs/grcov` Action can install `grcov` too,
# but can't use faster installation methods yet.
# As a temporary experiment `actions-rs/install` Action plugged in here.
# Consider **NOT** to copy that into your workflow,
# but use `actions-rs/grcov` only
- name: Pre-installing grcov
uses: actions-rs/[email protected]
with:
crate: grcov
use-tool-cache: true
- name: Gather coverage data
id: coverage
uses: actions-rs/[email protected]
- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
path-to-lcov: ${{ steps.coverage.outputs.report }}
grcov_finalize:
runs-on: ubuntu-latest
needs: grcov
steps:
- name: Coveralls finalization
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true