-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (32 loc) · 1 KB
/
Copy pathgo-build-windows-amd64.yml
File metadata and controls
38 lines (32 loc) · 1 KB
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
38
# 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:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.6
cache: true
- name: Build bundle
run: |
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -v -ldflags="-w -s" -o ./dist/windows-amd64/main.exe ./main.go
cd ./dist/windows-amd64/
tar zcvf ../../dist/main-windows-amd64.tgz ./*
cd ../../
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/heads/main')
with:
tag_name: Continuous-integration-${{ github.sha }}
#token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
files: |
dist/*.tgz