Files
schedule_converter/.github/workflows/build.yml
lafay a04e5c2c50
All checks were successful
Build / build (push) Successful in 6m33s
fix: 降级upload-artifact到v3以兼容Gitea
2026-03-19 11:39:42 +08:00

44 lines
1.0 KiB
YAML

name: Build
on:
push:
branches: [main, master]
create:
tag:
- 'v*'
pull_request:
branches: [main, master]
env:
GO_VERSION: '1.25'
APP_NAME: schedule_converter
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Download dependencies
run: go mod download
- name: Build Linux AMD64
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ${{ env.APP_NAME }}-linux-amd64 .
- name: Build Windows AMD64
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o ${{ env.APP_NAME }}-windows-amd64.exe .
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}
path: |
${{ env.APP_NAME }}-linux-amd64
${{ env.APP_NAME }}-windows-amd64.exe