This repository was archived by the owner on Aug 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (88 loc) · 2.29 KB
/
Copy pathbuild.yml
File metadata and controls
112 lines (88 loc) · 2.29 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
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
# 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 Build
on:
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: go build -o ghf-linux .
- uses: actions/upload-artifact@v3
with:
name: go-http-fileserver-linux
path: ghf-linux
build-macos:
runs-on: macos-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: go build -o ghf-macos .
- uses: actions/upload-artifact@v3
with:
name: go-http-fileserver-macos
path: ghf-macos
build-windows:
runs-on: windows-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: go build -o ghf-windows.exe .
- uses: actions/upload-artifact@v3
with:
name: go-http-fileserver-windows
path: ghf-windows.exe
create-release:
if: startsWith(github.event.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs:
- build-linux
- build-macos
- build-windows
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Pack built files
run: |
cd go-http-fileserver-linux
zip ../linux.zip ./*
cd ../
cd go-http-fileserver-macos
zip ../macos.zip ./*
cd ../
cd go-http-fileserver-windows
zip ../windows.zip ./*
cd ../
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: GHF - ${{ github.ref_name }}
generate_release_notes: true
files: |
linux.zip
macos.zip
windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}