Files
Nukumizu/.github/workflows/build.yml
T
NanamiAdmin cc4aebde6a
Build / ubuntu-latest (push) Canceled after 16s
Build / windows-latest (push) Canceled after 24s
feat(build): integrate frontend build into backend binary and update scripts
2026-09-22 22:57:08 +08:00

67 lines
1.8 KiB
YAML

name: Build
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# A newer push to the same ref makes an in-flight build obsolete.
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# Let both platforms finish, so a failure on one still reports the other.
fail-fast: false
matrix:
include:
# The .sh scripts are run through `bash` because a checkout made on
# Windows does not carry the executable bit, so ./build-*.sh would
# come back as "Permission denied" on the Linux runner.
- os: ubuntu-latest
build_linux: bash build-linux-x86_64.sh
- os: windows-latest
build_windows: ./build-win-x86_64.bat
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
# Each script builds the Vue console itself and then compiles it into the
# binary (web/embed.go), so the uploaded executables are self-contained.
- name: Build Linux (amd64)
run: ${{ matrix.build_linux }}
- name: Build Windows (amd64)
run: ${{ matrix.build_windows }}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: nukumizu-binaries-${{ matrix.os }}
path: |
nukumizu-linux-amd64
nukumizu-windows-amd64.exe
if-no-files-found: error