Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit 72d2f37

Browse files
committed
Merge branch 'master' of github.com:Crossbell-Box/go-http-fileserver
2 parents 47ef355 + 74cd1e4 commit 72d2f37

1 file changed

Lines changed: 106 additions & 0 deletions

File tree

.github/workflows/go.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Go Build
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
tags:
10+
- 'v*'
11+
pull_request:
12+
branches: [ master ]
13+
14+
jobs:
15+
16+
build-linux:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout codes
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v3
24+
with:
25+
go-version: 1.19
26+
27+
- name: Build
28+
run: go build -o ghf-linux .
29+
30+
- uses: actions/upload-artifact@v3
31+
with:
32+
name: go-http-fileserver-linux
33+
path: ghf-linux
34+
35+
36+
build-macos:
37+
runs-on: macos-latest
38+
steps:
39+
- name: Checkout codes
40+
uses: actions/checkout@v3
41+
42+
- name: Set up Go
43+
uses: actions/setup-go@v3
44+
with:
45+
go-version: 1.19
46+
47+
- name: Build
48+
run: go build -o ghf-macos .
49+
50+
- uses: actions/upload-artifact@v3
51+
with:
52+
name: go-http-fileserver-macos
53+
path: ghf-macos
54+
55+
56+
build-windows:
57+
runs-on: windows-latest
58+
steps:
59+
- name: Checkout codes
60+
uses: actions/checkout@v3
61+
62+
- name: Set up Go
63+
uses: actions/setup-go@v3
64+
with:
65+
go-version: 1.19
66+
67+
- name: Build
68+
run: go build -o ghf-windows.exe .
69+
70+
- uses: actions/upload-artifact@v3
71+
with:
72+
name: go-http-fileserver-windows
73+
path: ghf-windows.exe
74+
75+
create-release:
76+
if: startsWith(github.event.ref, 'refs/tags/')
77+
runs-on: ubuntu-latest
78+
needs:
79+
- build-linux
80+
- build-macos
81+
- build-windows
82+
steps:
83+
84+
- name: Download all workflow run artifacts
85+
uses: actions/download-artifact@v3
86+
87+
- name: Pack built files
88+
run: |
89+
zip go-http-fileserver-linux.zip ghf-linux
90+
zip go-http-fileserver-macos.zip ghf-macos
91+
zip go-http-fileserver-windows.zip ghf-windows.exe
92+
93+
- name: Create release
94+
uses: softprops/action-gh-release@v1
95+
with:
96+
name: GHF - ${GITHUB_REF_NAME}
97+
generate_release_notes: true
98+
files: |
99+
go-http-fileserver-linux.zip
100+
go-http-fileserver-macos.zip
101+
go-http-fileserver-windows.zip
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
105+
106+

0 commit comments

Comments
 (0)