breadcrumbs/.github/workflows/release.yml
Breadway 9b38504240
All checks were successful
Mirror to GitHub / mirror (push) Successful in 2s
Build and publish package / package (push) Successful in 1m31s
Release v2.1.0: backend test seam, captive-portal detection, JSON status, robustness
Features:
- Introduce a Backend trait + System impl so flow/status/watch can be unit
  tested against a fake; add 11 connect-state-machine tests.
- Captive-portal detection: status::connectivity returns Online/Portal/Offline;
  surfaced in status, JSON, connect notes, and a dedicated watch state.
- `status --json` for bars/scripts; `profile add`/`profile remove`; detect now
  scores by number of in-range markers.

Robustness:
- Pin LC_ALL=C/LANG=C on child processes for locale-independent parsing.
- Atomic config/state writes (temp + rename); 0600 config never world-readable.
- Transient PSK file written to $XDG_RUNTIME_DIR when available.

Fixes (from prior audit):
- Feed Wi-Fi PSK to nmcli via stdin/passwd-file, never argv.
- mask() no longer panics on multi-byte passwords.
- Connectivity check requires HTTP 204 (no captive-portal false positives).
- nmcli NAME,TYPE parsing handles escaped colons.
- Strip CIDR suffix from displayed IP; PKGBUILD/Cargo version aligned (2.1.0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015iGKg2EEqRuw6HyWd4tnmL
2026-06-23 12:13:34 +08:00

58 lines
1.7 KiB
YAML

name: release
on:
push:
tags: ["v*"]
permissions:
contents: write
env:
DL_DIR: /srv/breadway-dl
ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci
jobs:
build:
runs-on: [self-hosted, hestia]
steps:
- uses: actions/checkout@v4
- name: build
run: cargo build --release --locked
- name: test
run: cargo test --release --locked
- name: prepare artifacts
run: |
VERSION="${GITHUB_REF_NAME#v}"
PKG_DIR="${DL_DIR}/breadcrumbs/${VERSION}"
mkdir -p "${PKG_DIR}"
cp target/release/breadcrumbs "${PKG_DIR}/breadcrumbs-x86_64"
strip "${PKG_DIR}/breadcrumbs-x86_64"
sha256sum "${PKG_DIR}/breadcrumbs-x86_64" | awk '{print $1}' \
> "${PKG_DIR}/breadcrumbs-x86_64.sha256"
cp breadcrumbs.example.toml "${PKG_DIR}/"
cp bakery.toml "${PKG_DIR}/bakery.toml"
ln -sfn "${VERSION}" "${DL_DIR}/breadcrumbs/latest"
- name: ensure bread-ecosystem
run: |
rm -rf "${ECOSYSTEM_DIR}"
git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
- name: regenerate index.json
run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh"
- name: upload to GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${GITHUB_REF_NAME#v}"
PKG_DIR="${DL_DIR}/breadcrumbs/${VERSION}"
gh release create "${GITHUB_REF_NAME}" \
--title "breadcrumbs v${VERSION}" --generate-notes 2>/dev/null || true
gh release upload "${GITHUB_REF_NAME}" \
"${PKG_DIR}/breadcrumbs-x86_64" \
"${PKG_DIR}/breadcrumbs-x86_64.sha256" \
--clobber