Files
gpt-load/.github/workflows/release-linux.yml
2025-07-20 09:43:38 +08:00

48 lines
1.5 KiB
YAML

name: Release Linux Build
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache-dependency-path: "web/package-lock.json"
- name: Build Frontend
run: VITE_VERSION=${{ github.ref_name }} npm install && npm run build
working-directory: ./web
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: Build Go for amd64
run: |
go mod download
go build -ldflags "-s -w -X gpt-load/internal/version.Version=${{ github.ref_name }}"" -extldflags '-static'" -o gpt-load
- name: Build Go for arm64
run: |
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y gcc-aarch64-linux-gnu
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X gpt-load/internal/version.Version=${{ github.ref_name }}"" -extldflags '-static'" -o gpt-load-arm64
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
gpt-load
gpt-load-arm64
draft: true
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}