-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (110 loc) · 3.66 KB
/
build_and_release.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
118
119
120
121
122
123
124
125
126
127
128
129
130
# 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:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: release
uses: actions/create-release@v1.1.4
id: create_release
with:
draft: false
prerelease: false
release_name: ${{github.ref_name}}
tag_name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ github.token }}
# Build for Windows 64
- name: Build Windows 64
run: GOOS=windows GOARCH=amd64 ./build
- name: upload Windows 64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wmetrics.exe
asset_name: wmetrics_win_x64.exe
asset_content_type: application/octet-stream
# Build for Windows 32
- name: Build Windows 32
run: GOOS=windows GOARCH=386 ./build
- name: upload Windows 32 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wmetrics.exe
asset_name: wmetrics_win_x86.exe
asset_content_type: application/octet-stream
# Build for Linux amd64
- name: Build Linux amd64
run: GOOS=linux GOARCH=amd64 ./build
- name: upload Linux 64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wmetrics
asset_name: wmetrics_linux_amd64
asset_content_type: application/octet-stream
# Build for Linux arm64
- name: Build Linux arm64
run: GOOS=linux GOARCH=arm64 ./build
- name: upload Linux 64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wmetrics
asset_name: wmetrics_linux_arm64
asset_content_type: application/octet-stream
# Build for Linux 32
- name: Build Linux 32
run: GOOS=linux GOARCH=386 ./build
- name: upload Linux 32 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wmetrics
asset_name: wmetrics_linux_x86
asset_content_type: application/octet-stream
# Build for macOS amd64
- name: Build Mac OS 64
run: GOOS=darwin GOARCH=amd64 ./build
- name: upload Mac OS amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wmetrics
asset_name: wmetrics_macos_amd64
asset_content_type: application/octet-stream
# Build for macOS arm64
- name: Build Mac OS arm64
run: GOOS=darwin GOARCH=arm64 ./build
- name: upload Mac OS 64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wmetrics
asset_name: wmetrics_macos_arm64
asset_content_type: application/octet-stream