-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.5 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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: Release Build
on:
push:
branches: [ "master" ]
tags:
- 'v*.*.*'
pull_request:
branches: [ "master" ]
tags:
- 'v*.*.*'
jobs:
build:
strategy:
matrix:
# Include amd64 on all platforms.
goos: [ windows, linux ]
goarch: [ amd64, 386 ]
goamd64: [ v1 ]
exclude:
# Exclude i386 on darwin and dragonfly.
- goarch: 386
goos: dragonfly
runs-on: ubuntu-latest
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOAMD64: ${{ matrix.goamd64 }}
CGO_ENABLED: 0
BUILD_NAME: AutoInstall-${{ matrix.goos }}-${{ matrix.goarch }}-${{ matrix.goamd64 }}${{ matrix.goos == 'windows' && '.exe' || '' }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ^1.20
check-latest: true
- name: Build
run: go build -o dist/${{ env.BUILD_NAME }} app.go && ls dist
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
Publish:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
draft: true
fail_on_unmatched_files: true