Skip to content

macOS Build and Release #6

macOS Build and Release

macOS Build and Release #6

Workflow file for this run

name: macOS Build and Release
on:
push:
tags: ['v*'] # 仅在标签推送时触发
workflow_dispatch: # 允许手动触发
jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.25'
- name: Install V
run: |
git clone --depth=1 https://github.com/vlang/v
cd v
make
sudo ./v symlink
v version
- name: Install libgo dependency
run: v install KingBes.libgo
- name: Prebuild Go components
run: |
script_path="$HOME/.vmodules/kingbes/libgo/go/build.sh"
chmod +x "$script_path"
"$script_path"
- name: Build project
run: export ARCHFLAGS="-arch arm64" && v -cc gcc -os macos -o bny .
- name: Verify binary
run: |
file bny
./bny -v || true # 即使版本检查失败也继续
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bny-macos
path: bny
if-no-files-found: error