-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (167 loc) · 5.71 KB
/
Copy pathbugbite-cli.yml
File metadata and controls
200 lines (167 loc) · 5.71 KB
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
name: bugbite-cli
on:
push:
tags: [bugbite-cli-*]
branches: ['**']
paths:
- "Cross.toml"
- ".github/workflows/bugbite-cli.yml"
workflow_dispatch:
jobs:
man:
runs-on: ubuntu-latest
container:
image: asciidoctor/docker-asciidoctor
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Build docs
run: make -C doc man
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: man
path: target/doc/cli/man
if-no-files-found: error
retention-days: 1
shell:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: stable
- name: Generate files
run: cargo run --bin bite completion --dir shell
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: shell
path: shell
if-no-files-found: error
retention-days: 1
source:
if: startsWith(github.ref, 'refs/tags/')
needs: [man, shell]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: stable
- name: Create vendored release
run: .ci/vendor-release bugbite-cli
- name: Install cargo-nextest
uses: taiki-e/install-action@7a79fe8c3a13344501c80d99cae481c1c9085912 # v2.81.10
with:
tool: nextest
- name: Run tests for vendored release
run: |
# copy vendored release outside of the workspace to avoid cargo errors
cp -a ${{ github.ref_name }} ${HOME}
pushd ${HOME}/${{ github.ref_name }}
cargo nextest run --features test --tests
popd
rm -rf ${HOME}/${{ github.ref_name }}
- name: Download generated man pages
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: man
path: man
- name: Download generated shell completion
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: shell
path: shell
- name: Create archive
run: |
# move shell completion files into the release
mv man shell ${{ github.ref_name }}
# create the release tarball
tar -cv -I "xz -9 -T0" -f ${{ github.ref_name }}.tar.xz ${{ github.ref_name }}
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: source
path: ${{ github.ref_name }}.tar.xz
if-no-files-found: error
retention-days: 1
linux:
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: stable
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build binary
run: cross build --target ${{ matrix.target }} --profile release-strip -p bugbite-cli
- name: Create archive
run: |
tar -C target/${{ matrix.target }}/release-strip \
-cv -I "xz -9 -T0" -f ${{ github.ref_name }}-${{ matrix.target }}.tar.xz \
bite
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ github.ref_name }}-${{ matrix.target }}
path: ${{ github.ref_name }}-${{ matrix.target }}.tar.xz
if-no-files-found: error
retention-days: 1
macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: stable
- name: Build binary
run: cargo build --profile release-strip -p bugbite-cli
- name: Create archive
run: |
cd target/release-strip
zip $GITHUB_WORKSPACE/${{ github.ref_name }}-macos.zip bite
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ github.ref_name }}-macos
path: ${{ github.ref_name }}-macos.zip
if-no-files-found: error
retention-days: 1
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: [source, linux, macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: artifacts
merge-multiple: true
- name: Create GitHub release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda #v3.0.0
with:
files: |
artifacts/*.tar.xz
artifacts/${{ github.ref_name }}-macos.zip
fail_on_unmatched_files: true