94 lines
2.8 KiB
YAML
94 lines
2.8 KiB
YAML
name: release
|
|
run-name: Release ${{ github.ref_name }}
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
# My Machine has arm-musl stuff - or else i have to use cross :(
|
|
runs-on: [self-hosted, linux, fedora, wsl, release]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Ensure toolchain and targets
|
|
shell: pwsh
|
|
run: |
|
|
rustc -V
|
|
cargo -V
|
|
rustup target add armv7-unknown-linux-musleabihf
|
|
rustup target add x86_64-unknown-linux-gnu
|
|
rustup target add aarch64-unknown-linux-gnu
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: linux-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Build (armv7-musl)
|
|
shell: pwsh
|
|
run: |
|
|
cargo build --release --target armv7-unknown-linux-musleabihf -p wakey -p wakey-agent
|
|
|
|
- name: Build UI dist
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
cd ui
|
|
# corepack enable # no no no
|
|
pnpm install --frozen-lockfile
|
|
pnpm build
|
|
|
|
- name: Build control-plane (linux gnu)
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
for target in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do
|
|
cargo build --release --target "$target" -p wakey-control-plane
|
|
done
|
|
|
|
- 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@v3
|
|
with:
|
|
name: wakey-rootfs
|
|
path: dist/wakey-rootfs-*armv7-unknown-linux-musleabihf.tgz
|
|
|
|
- name: Upload control-plane bundles
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: wakey-cc-bundles
|
|
path: dist/wakey-cc-*unknown-linux-gnu.tgz
|
|
|
|
- name: Publish Release to Gitea
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
# use their personal repo cuz this searches github.com T_T
|
|
uses: akkuman/gitea-release-action@v1
|
|
with:
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
files: |
|
|
dist/wakey-rootfs-*armv7-unknown-linux-musleabihf.tgz
|
|
dist/wakey-cc-*unknown-linux-gnu.tgz
|
|
tag_name: ${{ github.ref_name }}
|