Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Security updates only: `open-pull-requests-limit: 0` disables version
# update pull requests while still allowing Dependabot security updates.
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
cooldown:
default-days: 7

- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
cooldown:
default-days: 7
49 changes: 39 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,37 @@ on:
push:
tags: [ "v[0-9]+.*" ]

permissions:
contents: write
permissions: {}

jobs:
verify:
if: github.repository_owner == 'ririsoft'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # master
with:
toolchain: stable

- name: Verify package can be published
run: cargo publish --dry-run

create-release:
if: github.repository_owner == 'ririsoft'
needs:
- verify
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/create-gh-release-action@v1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: taiki-e/create-gh-release-action@eba8ea96c86cca8a37f1b56e94b4d13301fba651 # v1.11.0
with:
changelog: CHANGELOG.md
title: $version
Expand All @@ -24,14 +44,23 @@ jobs:
needs:
- create-release
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # master
with:
toolchain: stable

- name: Verify package can be published
run: cargo publish --dry-run
- name: Authenticate to crates.io with trusted publishing
id: auth
uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5

- name: Publish package to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish
41 changes: 36 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
branches:
- master

permissions:
contents: read

jobs:
rust-ci:
runs-on: ${{ matrix.os }}
Expand All @@ -19,16 +22,19 @@ jobs:
steps:

- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # master
with:
toolchain: stable
components: rustfmt, clippy, llvm-tools-preview

# This workflow publishes no artifacts and release.yml uses no cache.
- name: Setup rust smart caching
uses: Swatinem/rust-cache@v2
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 # zizmor: ignore[cache-poisoning]
with:
cache-on-failure: "true"

Expand All @@ -45,8 +51,33 @@ jobs:
run: cargo test

- name: Setup cargo-llvm-cov
run: cargo install cargo-llvm-cov
run: cargo install cargo-llvm-cov --locked --version 0.9.1

- name: Run code coverage test
run: |
cargo llvm-cov test --fail-under-lines 90
cargo llvm-cov test --fail-under-lines 90

workflow-lint:
runs-on: ubuntu-latest
env:
ACTIONLINT_VERSION: 1.7.12
steps:
- name: Checkout sources
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Run actionlint
run: |
base="https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}"
archive="actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
curl -fsSLO "${base}/${archive}"
curl -fsSLO "${base}/actionlint_${ACTIONLINT_VERSION}_checksums.txt"
grep " ${archive}\$" "actionlint_${ACTIONLINT_VERSION}_checksums.txt" | sha256sum -c -
tar -xzf "${archive}" actionlint
./actionlint -color

- name: Run zizmor
uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
with:
advanced-security: false
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
### Security

- Hardened CI/CD supply chain: GitHub Actions pinned to commit SHAs, least-privilege
workflow permissions, crates.io trusted publishing (OIDC) from a protected `release`
environment, Dependabot security updates, and actionlint/zizmor workflow linting.

## [2.2.0] - 2026-09-28

### Fixed
Expand Down
Loading