Skip to content

Commit

Permalink
chore(ci): Harden CI
Browse files Browse the repository at this point in the history
  • Loading branch information
VorpalBlade committed Nov 3, 2024
1 parent 501e1cd commit 85a6e1c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
debug_info: off
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Environment info
run: |
echo "rustup --version:"; rustup --version
Expand Down Expand Up @@ -117,6 +119,8 @@ jobs:
- stable
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Rust
run: rustup install --profile minimal ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- name: Install libdbus
Expand Down Expand Up @@ -188,6 +192,8 @@ jobs:
rust: nightly
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Environment info
run: |
echo "rustup --version:"; rustup --version
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Rust
run: rustup update stable && rustup default stable && rustup component add clippy
Expand Down Expand Up @@ -60,6 +62,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Rust
run: rustup install --profile minimal stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check
Expand All @@ -68,6 +72,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Rust
run: rustup update stable && rustup default stable && rustup component add clippy
Expand All @@ -85,6 +91,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Rust
run: rustup update stable && rustup default stable && rustup component add clippy
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mdbook-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Install latest mdbook
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
persist-credentials: false
- name: Install Rust
run: |
rustup set profile minimal
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
name: Release

permissions:
attestations: write
contents: write
id-token: write

on:
push:
tags:
Expand All @@ -28,8 +23,13 @@ env:
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: taiki-e/[email protected]
with:
draft: true
Expand All @@ -39,8 +39,13 @@ jobs:
cargo-about:
needs: create-release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Rust
run: rustup update stable && rustup default stable && rustup component add clippy
- name: Get cargo-binstall
Expand All @@ -57,6 +62,10 @@ jobs:

upload-assets:
needs: create-release
permissions:
attestations: write
contents: write
id-token: write # Needed for attestations
strategy:
matrix:
include:
Expand Down Expand Up @@ -96,6 +105,8 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: taiki-e/[email protected]
id: upload-rust-binary-action
with:
Expand All @@ -119,6 +130,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
Expand All @@ -129,6 +142,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Get AUR repo
run: git clone https://aur.archlinux.org/chezmoi_modify_manager.git aur
- name: Update PKGBUILD
Expand Down

0 comments on commit 85a6e1c

Please sign in to comment.