-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (31 loc) · 1.29 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
workflow_dispatch:
inputs:
tag_name:
description: 'tag name'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
- run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/${{ github.event.repository.name }}_linux_x64 .
- run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/${{ github.event.repository.name }}_win_x64.exe
- run: CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o bin/${{ github.event.repository.name }}_win_arm64.exe .
- run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/${{ github.event.repository.name }}_darwin_x64 .
- run: CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o bin/${{ github.event.repository.name }}_darwin_arm64 .
- name: Release
uses: softprops/action-gh-release@v1
with: # 将下述可执行文件 release 上去
tag_name: ${{ github.event.inputs.tag_name }}
files: bin/*
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}