107 lines
3.0 KiB
YAML
107 lines
3.0 KiB
YAML
name: release
|
|
run-name: Release ${{ github.ref_name }}
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
cache: pnpm
|
|
cache-dependency-path: ui/pnpm-lock.yaml
|
|
|
|
- name: Install cross
|
|
run: cargo install cross --locked
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: linux-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Build (armv7-musl with cross)
|
|
run: |
|
|
cross build --release --target armv7-unknown-linux-musleabihf -p wakey -p wakey-agent
|
|
|
|
- name: Build UI dist
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
cd ui
|
|
pnpm install --frozen-lockfile
|
|
pnpm build
|
|
|
|
- name: Build control-plane (linux-gnu)
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
# x86_64 builds natively; aarch64 needs cross
|
|
echo "Building control-plane x86_64-unknown-linux-gnu (native)"
|
|
cargo build --release --target x86_64-unknown-linux-gnu -p wakey-control-plane
|
|
|
|
echo "Building control-plane aarch64-unknown-linux-gnu (cross)"
|
|
cross build --release --target aarch64-unknown-linux-gnu -p wakey-control-plane
|
|
|
|
- name: Package rootfs tarball
|
|
shell: pwsh
|
|
run: |
|
|
./scripts/package_rootfs.ps1 -Version "${{ github.ref_name }}" -Target armv7-unknown-linux-musleabihf
|
|
|
|
- name: Package control-plane bundles
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
chmod +x scripts/update_wakey_cc.sh scripts/package_wakey_cc_bundle.sh
|
|
for target in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do
|
|
./scripts/package_wakey_cc_bundle.sh --version "${{ github.ref_name }}" --target "$target"
|
|
done
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: wakey-rootfs
|
|
path: dist/wakey-rootfs-*armv7-unknown-linux-musleabihf.tgz
|
|
|
|
- name: Upload control-plane bundles
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: wakey-cc-bundles
|
|
path: dist/wakey-cc-*unknown-linux-gnu.tgz
|
|
|
|
- name: Publish Release to GitHub
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
tag_name: ${{ github.ref_name }}
|
|
files: |
|
|
dist/wakey-rootfs-*armv7-unknown-linux-musleabihf.tgz
|
|
dist/wakey-cc-*unknown-linux-gnu.tgz
|