Build way-node / Test, Build, Push (push) Failing after 14s
- Go module: github.com/cedar2025/xboard-node → github.com/viaeon/way-node(307 处 import 同步) - cmd/xboard-node/ → cmd/way-node/ - install.sh: APP_NAME / INSTALL_ROOT(/etc/way-node) / BINARY_PATH / SERVICE_NAME 全部更名, 下载源与 Documentaion 指向 git.viaeon.com/admin/way-node - Makefile / Dockerfile 产物与镜像路径更名 - README 全篇重写链接 - 新增 .gitea/workflows/build.yml:容器内跑测试 + 交叉编译 + 构建镜像推 git.viaeon.com/admin/way-node 构建全程在 golang:1.26 容器里,不依赖 runner 宿主装 Go - 禁用 .github/workflows/ci.yml(依赖 ghcr.io 与 GITHUB_TOKEN,Gitea 上跑不通) 保留:xbctl 工具名(不含旧品牌)、go.sum 里上游依赖哈希
129 lines
3.2 KiB
Plaintext
129 lines
3.2 KiB
Plaintext
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master, dev]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25.7'
|
|
cache: true
|
|
|
|
- name: Run tests
|
|
run: make test
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- goos: linux
|
|
goarch: amd64
|
|
- goos: linux
|
|
goarch: arm64
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25.7'
|
|
cache: true
|
|
|
|
- name: Build
|
|
env:
|
|
VERSION: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || github.sha }}
|
|
run: |
|
|
if [ "${{ matrix.goarch }}" = "amd64" ]; then
|
|
make build-linux
|
|
else
|
|
make build-linux-arm64
|
|
fi
|
|
|
|
- name: Upload way-node artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: way-node-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
path: way-node-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
|
|
- name: Upload xbctl artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: xbctl-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
path: xbctl-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
|
|
build-docker:
|
|
name: Build & Push Docker Image
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Log in to GHCR
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: |
|
|
git.viaeon.com/admin/way-node:latest
|
|
git.viaeon.com/admin/way-node:${{ github.sha }}
|
|
${{ startsWith(github.ref, 'refs/tags/') && format('git.viaeon.com/admin/way-node:{0}', github.ref_name) || '' }}
|
|
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/dev'
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
merge-multiple: true
|
|
path: dist
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'dev' }}
|
|
make_latest: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
files: |
|
|
dist/way-node-linux-amd64
|
|
dist/way-node-linux-arm64
|
|
dist/xbctl-linux-amd64
|
|
dist/xbctl-linux-arm64
|