Skip to content

Commit 213324f

Browse files
committed
ci: Harden worfkflows
1 parent 18ee52a commit 213324f

3 files changed

Lines changed: 36 additions & 30 deletions

File tree

.github/workflows/boil_pr.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
contents: read
1414

1515
env:
16-
RUST_VERSION: 1.89.0
16+
RUST_TOOLCHAIN_VERSION: 1.89.0
1717

1818
jobs:
1919
# This job is always run to ensure we don't miss any new upstream advisories
@@ -56,12 +56,13 @@ jobs:
5656
with:
5757
persist-credentials: false
5858

59-
- uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921
60-
with:
61-
toolchain: ${{ env.RUST_VERSION }}
62-
targets: ${{ matrix.targets.target }}
59+
- name: Setup Rust Toolchain
60+
env:
61+
RUST_TARGETS: ${{ matrix.targets.target }}
62+
shell: bash
63+
run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --target "${RUST_TARGETS}"
6364

6465
- name: Build Binary
6566
env:
66-
TARGET: ${{ matrix.targets.target }}
67-
run: cargo build --target "$TARGET" --package boil
67+
RUST_TARGETS: ${{ matrix.targets.target }}
68+
run: cargo build --target "${RUST_TARGETS}" --package boil

.github/workflows/boil_release.yaml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ on:
99
permissions: {}
1010

1111
env:
12-
RUST_VERSION: 1.89.0
12+
RUST_TOOLCHAIN_VERSION: 1.89.0
13+
RELEASE_TAG: ${{ github.ref_name }}
1314

1415
jobs:
1516
create-release:
@@ -34,10 +35,11 @@ jobs:
3435
args: --latest --strip header
3536

3637
- name: Create Draft Release
37-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
38-
with:
39-
body: ${{ steps.changelog.outputs.content }}
40-
draft: true
38+
env:
39+
RELEASE_NOTES: ${{ steps.changelog.outputs.content }}
40+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
shell: bash
42+
run: gh release create --draft --verify-tag --notes "$RELEASE_NOTES" "RELEASE_TAG"
4143

4244
build:
4345
name: Build boil
@@ -60,10 +62,11 @@ jobs:
6062
with:
6163
persist-credentials: false
6264

63-
- uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921
64-
with:
65-
toolchain: ${{ env.RUST_VERSION }}
66-
targets: ${{ matrix.targets.target }}
65+
- name: Setup Rust Toolchain
66+
env:
67+
RUST_TARGETS: ${{ matrix.targets.target }}
68+
shell: bash
69+
run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --target "${RUST_TARGETS}"
6770

6871
- name: Build Binary
6972
env:
@@ -76,10 +79,10 @@ jobs:
7679
run: mv "target/$TARGET/release/boil" "boil-$TARGET"
7780

7881
- name: Upload Artifact to Release
79-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
80-
with:
81-
files: boil-${{ matrix.targets.target }}
82-
draft: true
82+
env:
83+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
shell: bash
85+
run: gh release upload "RELEASE_TAG" boil-${{ matrix.targets.target }}
8386

8487
finish-release:
8588
needs: [build]
@@ -90,6 +93,7 @@ jobs:
9093
contents: write
9194
steps:
9295
- name: Finish Release
93-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
94-
with:
95-
draft: false
96+
env:
97+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
shell: bash
99+
run: gh release edit --draft=false "$RELEASE_TAG"

.github/workflows/patchable_pr.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
contents: read
1414

1515
env:
16-
RUST_VERSION: 1.89.0
16+
RUST_TOOLCHAIN_VERSION: 1.89.0
1717

1818
jobs:
1919
# This job is always run to ensure we don't miss any new upstream advisories
@@ -56,12 +56,13 @@ jobs:
5656
with:
5757
persist-credentials: false
5858

59-
- uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921
60-
with:
61-
toolchain: ${{ env.RUST_VERSION }}
62-
targets: ${{ matrix.targets.target }}
59+
- name: Setup Rust Toolchain
60+
env:
61+
RUST_TARGETS: ${{ matrix.targets.target }}
62+
shell: bash
63+
run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --target "${RUST_TARGETS}"
6364

6465
- name: Build Binary
6566
env:
66-
TARGET: ${{ matrix.targets.target }}
67-
run: cargo build --target "$TARGET" --package patchable
67+
RUST_TARGETS: ${{ matrix.targets.target }}
68+
run: cargo build --target "${RUST_TARGETS}" --package patchable

0 commit comments

Comments
 (0)