This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
99 lines (85 loc) · 3.26 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
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Build AMD64
run: |
version=`cat version`
cd src
timestamp=`date "+%Y-%m-%d %H:%M:%S"`
echo "version -> $version"
echo "timestamp -> $timestamp"
GOARCH=amd64 GOOS=windows go build -ldflags "-s -w -X main.version=$version -X \"main.timestamp=$timestamp\"" -o ~/release/fgit-windows-amd64.exe ./
GOARCH=amd64 GOOS=darwin go build -ldflags "-s -w -X main.version=$version -X \"main.timestamp=$timestamp\"" -o ~/release/fgit-darwin-amd64 ./
GOARCH=amd64 GOOS=linux go build -ldflags "-s -w -X main.version=$version -X \"main.timestamp=$timestamp\"" -o ~/release/fgit-linux-amd64 ./
- name: Build 386
run: |
version=`cat version`
cd src
timestamp=`date "+%Y-%m-%d %H:%M:%S"`
echo "version -> $version"
echo "timestamp -> $timestamp"
GOARCH=386 GOOS=windows go build -ldflags "-s -w -X main.version=$version -X \"main.timestamp=$timestamp\"" -o ~/release/fgit-windows-386.exe ./
GOARCH=386 GOOS=linux go build -ldflags "-s -w -X main.version=$version -X \"main.timestamp=$timestamp\"" -o ~/release/fgit-linux-386 ./
- name: Build ARM
run: |
version=`cat version`
cd src
timestamp=`date "+%Y-%m-%d %H:%M:%S"`
echo "version -> $version"
echo "timestamp -> $timestamp"
GOARCH=arm GOOS=linux go build -ldflags "-s -w -X main.version=$version -X \"main.timestamp=$timestamp\"" -o ~/release/fgit-linux-arm ./
- name: Build ARM64
run: |
version=`cat version`
cd src
timestamp=`date "+%Y-%m-%d %H:%M:%S"`
echo "version -> $version"
echo "timestamp -> $timestamp"
GOARCH=arm64 GOOS=linux go build -ldflags "-s -w -X main.version=$version -X \"main.timestamp=$timestamp\"" -o ~/release/fgit-linux-arm64 ./
- name: Upload Artifact (Windows x64)
uses: actions/[email protected]
with:
name: fgit-windows-amd64.exe
path: ~/release/fgit-windows-amd64.exe
- name: Upload Artifact (Darwin x64)
uses: actions/[email protected]
with:
name: fgit-darwin-amd64
path: ~/release/fgit-darwin-amd64
- name: Upload Artifact (Linux x64)
uses: actions/[email protected]
with:
name: fgit-linux-amd64
path: ~/release/fgit-linux-amd64
- name: Upload Artifact (Linux i386)
uses: actions/[email protected]
with:
name: fgit-linux-386
path: ~/release/fgit-linux-386
- name: Upload Artifact (Windows i386)
uses: actions/[email protected]
with:
name: fgit-windows-386.exe
path: ~/release/fgit-windows-386.exe
- name: Upload Artifact (Linux arm)
uses: actions/[email protected]
with:
name: fgit-linux-arm
path: ~/release/fgit-linux-arm
- name: Upload Artifact (Linux arm64)
uses: actions/[email protected]
with:
name: fgit-linux-arm64
path: ~/release/fgit-linux-arm64