feat(czdev): add login, publish, unpublish commands

- czdev login: GitHub OAuth Device Flow authentication
- czdev publish: upload .deb to CardputerZero/packages via PR
  - Preflight: .desktop check, email match, version bump check
- czdev unpublish: ownership-verified removal PR
- release-czdev.yml: cross-compile for macOS/Linux/Windows

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
LiHaohua
2026-05-09 15:03:06 +08:00
co-authored by Claude Opus 4.6
parent e9d54237d1
commit 544f75c33b
8 changed files with 1520 additions and 12 deletions
+83
View File
@@ -0,0 +1,83 @@
name: Release czdev
on:
push:
tags: ['czdev-v*']
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
artifact: czdev-linux-x86_64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
artifact: czdev-linux-aarch64
- target: x86_64-apple-darwin
os: macos-latest
artifact: czdev-macos-x86_64
- target: aarch64-apple-darwin
os: macos-latest
artifact: czdev-macos-aarch64
- target: x86_64-pc-windows-msvc
os: windows-latest
artifact: czdev-windows-x86_64.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross-compilation tools (Linux aarch64)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config.toml
echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
- name: Build
run: cargo build --release --target ${{ matrix.target }} -p czdev
- name: Rename artifact (Unix)
if: runner.os != 'Windows'
run: cp target/${{ matrix.target }}/release/czdev ${{ matrix.artifact }}
- name: Rename artifact (Windows)
if: runner.os == 'Windows'
run: cp target/${{ matrix.target }}/release/czdev.exe ${{ matrix.artifact }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/*