Skip to content

Commit e13fe70

Browse files
authored
ci(boil): Improve and split workflows (#1282)
* ci: Improve and split boil workflows * chore: Update yamllint config
1 parent 4a3d6b6 commit e13fe70

File tree

3 files changed

+71
-36
lines changed

3 files changed

+71
-36
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
---
2-
name: Build/Release boil
2+
name: Build boil
33

44
on:
55
pull_request:
66
paths:
7-
- '.github/workflows/boil_build_release.yaml'
8-
- 'rust-toolchain.toml'
9-
- 'Cargo.*'
10-
- '**.rs'
11-
push:
12-
tags:
13-
- "boil-[0-9]+.[0-9]+.[0-9]+**"
7+
- ".github/workflows/boil_pr.yaml"
8+
- "rust-toolchain.toml"
9+
- "rust/boil/**.rs"
10+
- "Cargo.*"
1411

1512
env:
1613
RUST_VERSION: 1.87.0
@@ -39,18 +36,6 @@ jobs:
3936
with:
4037
command: check ${{ matrix.checks }}
4138

42-
create-release:
43-
name: Create Draft Release
44-
if: github.event_name == 'push'
45-
needs:
46-
- cargo-deny
47-
runs-on: ubuntu-latest
48-
steps:
49-
- name: Create Draft Release
50-
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
51-
with:
52-
draft: true
53-
5439
build:
5540
name: Build boil
5641
needs:
@@ -59,9 +44,9 @@ jobs:
5944
fail-fast: false
6045
matrix:
6146
targets:
62-
- {target: aarch64-unknown-linux-gnu, os: ubuntu-24.04-arm}
63-
- {target: x86_64-unknown-linux-gnu, os: ubuntu-latest}
64-
- {target: aarch64-apple-darwin, os: macos-latest}
47+
- { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04-arm }
48+
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
49+
- { target: aarch64-apple-darwin, os: macos-latest }
6550
runs-on: ${{ matrix.targets.os }}
6651
steps:
6752
- name: Checkout
@@ -77,16 +62,4 @@ jobs:
7762
- name: Build Binary
7863
env:
7964
TARGET: ${{ matrix.targets.target }}
80-
run: cargo build --target "$TARGET" --release --package boil
81-
82-
- name: Rename Binary
83-
env:
84-
TARGET: ${{ matrix.targets.target }}
85-
run: mv "target/$TARGET/release/boil" "boil-$TARGET"
86-
87-
- name: Upload Artifact to Release
88-
if: github.event_name == 'push'
89-
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
90-
with:
91-
draft: false
92-
files: boil-${{ matrix.targets.target }}
65+
run: cargo build --target "$TARGET" --package boil
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: Release boil
3+
4+
on:
5+
push:
6+
tags:
7+
- "boil-[0-9]+.[0-9]+.[0-9]+**"
8+
9+
env:
10+
RUST_VERSION: 1.87.0
11+
12+
jobs:
13+
create-release:
14+
name: Create Draft Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Create Draft Release
18+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
19+
with:
20+
draft: true
21+
22+
build:
23+
name: Build boil
24+
needs:
25+
- create-release
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
targets:
30+
- { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04-arm }
31+
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
32+
- { target: aarch64-apple-darwin, os: macos-latest }
33+
runs-on: ${{ matrix.targets.os }}
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
37+
with:
38+
persist-credentials: false
39+
40+
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
41+
with:
42+
toolchain: ${{ env.RUST_VERSION }}
43+
targets: ${{ matrix.targets.target }}
44+
45+
- name: Build Binary
46+
env:
47+
TARGET: ${{ matrix.targets.target }}
48+
run: cargo build --target "$TARGET" --release --package boil
49+
50+
- name: Rename Binary
51+
env:
52+
TARGET: ${{ matrix.targets.target }}
53+
run: mv "target/$TARGET/release/boil" "boil-$TARGET"
54+
55+
- name: Upload Artifact to Release
56+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
57+
with:
58+
draft: false
59+
files: boil-${{ matrix.targets.target }}

.yamllint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ rules:
1111
comments:
1212
min-spaces-from-content: 1 # Needed due to https://github.com/adrienverge/yamllint/issues/443
1313
indentation: disable
14+
braces:
15+
max-spaces-inside: 1
16+
max-spaces-inside-empty: 0

0 commit comments

Comments
 (0)