Release workflow を taiki-e/upload-rust-binary-action に差し替える#26
Merged
Conversation
Douile/rust-build.action@v0.1.26 ships with a Cargo old enough that it cannot parse Cargo.lock format version 4 (generated by recent Rust toolchains), so `cargo build` errors out before any binary is built. Replace it with taiki-e/upload-rust-binary-action, which provisions an up-to-date toolchain and handles archiving / checksumming / asset upload in one step. Pin both that action and actions/checkout to specific commit SHAs to reduce supply-chain attack surface.
n01e0
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0.7.0 のリリースワークフローが
Cargo.lockを parse できずに失敗したのでリリース基盤を差し替えます。Background
0.7.0 の Release workflow run ( https://github.com/pepabo/octx/actions/runs/24889088596 ) は以下のエラーで失敗しました。
現行の
Douile/rust-build.action@v0.1.26は 2022 年の action で、同梱 Cargo が lockfile version 4 に対応していないのが原因です。recent な Rust toolchain ( 1.78 以降 ) で生成されるCargo.lockは v4 になります。なお、Douile/rust-build.actionの最新版である v1.4.5 (2024-02-25 リリース) でも Dockerfile がFROM rust:1.76.0-alpine3.19で固定されており、同じく lockfile v4 を parse できません。Changes
Douile/rust-build.actionをtaiki-e/upload-rust-binary-actionに差し替えました。 cargo build から tar.gz/zip 圧縮・ sha256 checksum 生成・ GitHub Release への asset upload まで 1 step で扱えますdtolnay/rust-toolchain@stableで stable toolchain を明示的にインストールして default に設定する step を挟みましたactions/checkout@masterから固定タグの SHA pin に変更actions/checkoutv6.0.2 →de0fac2e4500dabe0009e67214ff5f5447ce83dd、dtolnay/rust-toolchain@stable→29eef336d9b2848a0b548edc03f92a220660cdb8、taiki-e/upload-rust-binary-actionv1.30.2 →f0d45ae91ee7b8ee928de7a9d04d893a08bcbec6)。タグは書き換え可能なためサプライチェーン攻撃対策として SHA pin を採用dtolnay/rust-toolchainを明示する理由taiki-e/upload-rust-binary-actionは内部で Rust toolchain をインストール しない 設計になっています (main.sh内ではrustup target addを呼ぶだけ: https://github.com/taiki-e/upload-rust-binary-action/blob/v1.30.2/main.sh#L294 )。つまり runner にプリインストールされている Rust (rustup) の default toolchain が使われます。ubuntu-latestrunner のプリインストール Rust は GitHub が定期的に更新しており、現在は 1.89 相当 ( https://github.com/actions/runner-images でイメージの履歴が確認できます)そこで
dtolnay/rust-toolchain@stableを先に挟み、rustup toolchain install stable --profile minimal+rustup default stableを明示的に実行することで、 runner のプリインストール状態に依存せず常に stable が使われる形にしています。Followup