Skip to content

Commit 0277cb2

Browse files
committed
ci: restructured release build
The new "Release" job combines release build, test, documentation, and deb/rpm packaging. The documentation depends on the release build and the packages depend on the documentation build, so combining them avoids some lengthy/redundant build steps.
1 parent dd6081a commit 0277cb2

File tree

1 file changed

+70
-64
lines changed

1 file changed

+70
-64
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,80 @@ on:
1010
- cron: '30 1 * * 0'
1111

1212
jobs:
13+
release:
14+
name: Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v3
19+
- name: Install Rust
20+
uses: dtolnay/rust-toolchain@master
21+
with:
22+
toolchain: stable
23+
components: clippy, rustfmt
24+
- name: Build
25+
run: |
26+
cargo --locked build --profile release
27+
- name: Install Test Dependencies
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install quilt gnupg2 libio-pty-perl
31+
- name: Test
32+
env:
33+
STG_PROVE_OPTS: "--jobs=2"
34+
STG_TEST_OPTS: "--verbose-log"
35+
STG_PROFILE: "release"
36+
run: |
37+
timeout 900s make -C t prove
38+
- name: Show Failures
39+
if: ${{ failure() }}
40+
run: |
41+
make -C t show-failure-results
42+
- name: Install Doc Dependencies
43+
run: |
44+
sudo apt-get install asciidoc asciidoctor docbook-xsl-ns xmlto
45+
- name: Build Docs Asciidoc
46+
run: |
47+
make -j2 doc
48+
- name: Build Docs Asciidoctor
49+
run: |
50+
make -j2 USE_ASCIIDOCTOR=1 doc
51+
- name: Install HTML Docs
52+
run: |
53+
make -j2 USE_ASCIIDOCTOR=1 htmldir="$GITHUB_WORKSPACE"/stgit-html install-html
54+
- name: Upload HTML Docs
55+
uses: actions/upload-artifact@v3
56+
with:
57+
name: html-doc
58+
path: ${{ github.workspace }}/stgit-html
59+
- name: Install cargo-deb
60+
uses: baptiste0928/cargo-install@v2
61+
with:
62+
crate: cargo-deb
63+
- name: Install cargo-generate-rpm
64+
uses: baptiste0928/cargo-install@v2
65+
with:
66+
crate: cargo-generate-rpm
67+
- name: Build Packages
68+
run: |
69+
make USE_ASCIIDOCTOR=1 deb rpm
70+
- name: Upload deb
71+
uses: actions/upload-artifact@v3
72+
with:
73+
name: stgit-deb
74+
path: target/debian/stgit_*.deb
75+
- name: Upload rpm
76+
uses: actions/upload-artifact@v3
77+
with:
78+
name: stgit-rpm
79+
path: target/generate-rpm/stgit-*.rpm
80+
1381
build-and-test:
1482
name: Build and Test
1583
strategy:
1684
fail-fast: false
1785
matrix:
1886
include:
19-
- os: ubuntu-latest
20-
profile: release
21-
toolchain: stable
2287
- os: ubuntu-latest
2388
profile: dev
2489
toolchain: stable
@@ -38,7 +103,7 @@ jobs:
38103
toolchain: ${{ matrix.toolchain }}
39104
- name: Build
40105
run: |
41-
cargo --locked build --all-features --profile ${{ matrix.profile }}
106+
cargo --locked build --profile ${{ matrix.profile }}
42107
- name: Install Test Dependencies (Ubuntu)
43108
if: matrix.os == 'ubuntu-latest'
44109
run: |
@@ -123,65 +188,6 @@ jobs:
123188
run: |
124189
cargo rustdoc -- --deny warnings
125190
126-
docs:
127-
name: User Documentation
128-
runs-on: ubuntu-latest
129-
steps:
130-
- name: Checkout Repository
131-
uses: actions/checkout@v3
132-
- name: Install Rust
133-
uses: dtolnay/rust-toolchain@master
134-
with:
135-
toolchain: stable
136-
- name: Install dependencies
137-
run: |
138-
sudo apt-get update
139-
sudo apt-get install asciidoc asciidoctor docbook-xsl-ns xmlto
140-
- name: Build Docs Asciidoc
141-
run: |
142-
make -j2 doc
143-
- name: Build Docs Asciidoctor
144-
run: |
145-
make -j2 USE_ASCIIDOCTOR=1 doc
146-
- name: Install HTML Docs
147-
run: |
148-
make -j2 USE_ASCIIDOCTOR=1 htmldir="$GITHUB_WORKSPACE"/stgit-html install-html
149-
- name: Upload HTML Docs
150-
uses: actions/upload-artifact@v3
151-
with:
152-
name: html-doc
153-
path: ${{ github.workspace }}/stgit-html
154-
155-
packages:
156-
name: Prebuilt Packages
157-
runs-on: ubuntu-latest
158-
steps:
159-
- name: Checkout Repository
160-
uses: actions/checkout@v3
161-
- name: Install Rust
162-
uses: dtolnay/rust-toolchain@master
163-
with:
164-
toolchain: stable
165-
- name: Install cargo-deb
166-
run: |
167-
cargo install cargo-deb
168-
- name: Install cargo-generate-rpm
169-
run: |
170-
cargo install cargo-generate-rpm
171-
- name: Build Packages
172-
run: |
173-
make deb rpm
174-
- name: Upload deb
175-
uses: actions/upload-artifact@v3
176-
with:
177-
name: stgit-deb
178-
path: target/debian/stgit_*.deb
179-
- name: Upload rpm
180-
uses: actions/upload-artifact@v3
181-
with:
182-
name: stgit-rpm
183-
path: target/generate-rpm/stgit-*.rpm
184-
185191
windows-build:
186192
name: Windows Build
187193
runs-on: windows-latest
@@ -194,7 +200,7 @@ jobs:
194200
toolchain: stable
195201
- name: Build
196202
run: |
197-
cargo --locked build --all-features --profile release
203+
cargo --locked build --profile release
198204
- name: Setup MSYS2
199205
uses: msys2/setup-msys2@v2
200206
with:

0 commit comments

Comments
 (0)