-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.23 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
38
39
40
41
42
43
44
45
# 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: auto-deploy
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@v4
with:
go-version: '1.22.5'
- name: Install dependencies
working-directory: ./
run: go mod tidy
- name: Build for Linux x64
working-directory: ./
run: GOOS=linux GOARCH=amd64 go build -o build/go-iceinu-linux-amd64-${{ github.sha }} .
- name: Build for Windows x64
working-directory: ./
run: GOOS=windows GOARCH=amd64 go build -o build/go-iceinu-windows-amd64-${{ github.sha }}.exe .
- name: Upload Linux binary
uses: actions/upload-artifact@v3
with:
name: go-iceinu-linux-amd64-${{ github.sha }}
path: ./build/go-iceinu-linux-amd64-${{ github.sha }}
- name: Upload Windows binary
uses: actions/upload-artifact@v3
with:
name: go-iceinu-windows-amd64-${{ github.sha }}
path: ./build/go-iceinu-windows-amd64-${{ github.sha }}.exe