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
49 changes: 49 additions & 0 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Cross build

# Release targets are otherwise built only when a v* tag is pushed. Build them on
# pull requests that change dependencies (Renovate, manual upgrades) so an update
# that breaks only arm / musl is caught before it is merged.
on:
pull_request:
paths:
- Cargo.toml
- Cargo.lock
- Cross.toml
- .github/workflows/cross.yml
- .github/workflows/release.yml
workflow_dispatch:

permissions:
contents: read

concurrency:
group: cross-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: build ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# the same targets as release.yml (x86_64-unknown-linux-gnu is covered by ci.yml)
target:
- x86_64-unknown-linux-musl
- armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabihf
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
- name: Build (release profile, like release.yml)
run: cross build --release --target ${{ matrix.target }}
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cargo run # 設定は環境変数 RPROXY_* か .env(.env.e
- 設定項目は `src/main.rs` の `Options`(clap)。すべて `RPROXY_*` 環境変数でも指定でき、起動時に `.env` を読む。項目を増やすときは `.env.example` と README の表も更新する。

- ring(rustls)のビルドには C コンパイラが要る。
- `Cargo.toml` を変える PR(Renovate を含む)では `.github/workflows/cross.yml` がリリースと同じターゲット(arm・musl)をビルドする(ARM や musl だけで壊れる依存の更新を、マージ前に見つけるため)。
- リリースは `v*` タグの push で `.github/workflows/release.yml` が Linux の 6 ターゲット(x86_64・aarch64・armv7 の gnu と musl)向けにクロスビルドし、amd64 / arm64 / armhf の `.deb`(musl の静的リンク)を作って `gh-pages` の apt リポジトリに載せる。タグと `Cargo.toml` の `version` を揃えること。詳細は `docs/APT.md`。
- `scripts/install.sh` は VM 向けのインストーラ(root・systemd が前提。Debian / Ubuntu は apt、それ以外はリリースのバイナリ)。設定の雛形は `debian/rproxy.env` と `contrib/rproxy-api.service` を使う(チェックアウトから実行したときは手元のもの、curl で実行したときは GitHub のもの)。CI の `install.sh` ジョブ(`scripts/test-install.sh`)で実際に入れて確かめる。
- パッケージ(`debian/`、`[package.metadata.deb]`)を変えたら `cargo deb` で作り、CI の `Debian package` ジョブ(`scripts/test-deb.sh`。sudo でインストールするので手元では実行しない)で確かめる。`debian/rproxy-api.service` は `contrib/rproxy-api.service` と `ExecStart` 以外を揃える。
Expand Down
Loading