56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
name: release
|
|
run-name: Release ${{ github.ref_name }}
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: [self-hosted, windows]
|
|
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
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Build (armv7-musl)
|
|
shell: pwsh
|
|
run: |
|
|
cargo build --release --target armv7-unknown-linux-musleabihf
|
|
|
|
- name: Package rootfs tarball
|
|
shell: pwsh
|
|
run: |
|
|
./scripts/package_rootfs.ps1 -Version "${{ github.ref_name }}" -Target armv7-unknown-linux-musleabihf
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: wakey-rootfs
|
|
path: dist/wakey-rootfs-*armv7-unknown-linux-musleabihf.tgz
|
|
|
|
- name: Publish Release to Gitea (API)
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
shell: pwsh
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
./scripts/ci_gitea_release.ps1 -Tag "$env:GITHUB_REF_NAME" -AssetPattern "dist/wakey-rootfs-*armv7-unknown-linux-musleabihf.tgz"
|