-
Notifications
You must be signed in to change notification settings - Fork 3
117 lines (99 loc) · 3.68 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# 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: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Test
run: go test -v ./...
- name: Build Linux amd64
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o dmrfill_linux_amd64
- name: Build Linux arm
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -v -o dmrfill_linux_arm
- name: Build Linux arm64
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -v -o dmrfill_linux_arm64
- name: Build MacOS amd64
run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -v -o dmrfill_darwin_amd64
- name: Build MacOS arm64
run: CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -v -o dmrfill_darwin_arm64
- id: new_version
uses: paulhatch/[email protected]
with:
branch: "master"
tag_prefix: "v"
# A string which, if present in a git commit, indicates that a change represents a
# major (breaking) change
major_pattern: "(MAJOR)"
# Same as above except indicating a minor change
minor_pattern: "(MINOR)"
# A string to determine the format of the version output
version_format: "${major}.${minor}.${patch}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.new_version.outputs.version }}
release_name: Release v${{ steps.new_version.outputs.version }}
draft: false
prerelease: false
- name: Upload Linux/amd64 Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dmrfill_linux_amd64
asset_name: dmrfill_linux_amd64
asset_content_type: application/octet-stream
- name: Upload Linux/arm64 Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dmrfill_linux_arm64
asset_name: dmrfill_linux_arm64
asset_content_type: application/octet-stream
- name: Upload Linux/arm Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dmrfill_linux_arm
asset_name: dmrfill_linux_arm
asset_content_type: application/octet-stream
- name: Upload MacOS/amd64 Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dmrfill_darwin_amd64
asset_name: dmrfill_darwin_amd64
asset_content_type: application/octet-stream
- name: Upload MacOS/arm64 Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dmrfill_darwin_arm64
asset_name: dmrfill_darwin_arm64
asset_content_type: application/octet-stream