-
Notifications
You must be signed in to change notification settings - Fork 1
152 lines (152 loc) · 4.7 KB
/
Copy pathdevelop.yaml
File metadata and controls
152 lines (152 loc) · 4.7 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Develop
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
jobs:
build-linux:
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: auto
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Checkout code
uses: actions/checkout@v2
with:
path: ./src/github.com/${{ github.repository }}
submodules: true
- name: Install apt dependecies
run: |
sudo apt-get update && sudo apt-get install libgit2-dev libssh2-1-dev libssl-dev cmake
- name: Install go dependencies
run: |
go get -d github.com/Masterminds/sprig
- name: Install git2go
run: |
go get -d github.com/libgit2/git2go
cd $GOPATH/src/github.com/libgit2/git2go
git submodule update --init # get libgit2
cd vendor/libgit2
mkdir build && cd build
cmake ..
cd ../../..
make install-static
cd $GOPATH
- name: Build
run: |
go get -v -d github.com/DEVELOPEST/gtm-core
cd $GOPATH/src/github.com/DEVELOPEST/gtm-core
mkdir build
go build --tags static -o build/ ./...
cd build/
mv gtm-core gtm
chmod +x gtm
cd $GOPATH
- uses: actions/upload-artifact@v2
with:
name: gtm-linux
path: ./src/github.com/${{ github.repository }}/build/
build-windows:
runs-on: windows-latest
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: auto
steps:
- uses: crazy-max/ghaction-chocolatey@v1
with:
args: -h
- name: Install dependecies
run: |
choco install pkgconfiglite
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Checkout code
uses: actions/checkout@v2
with:
path: ./src/github.com/${{ github.repository }}
submodules: true
- name: Install go dependencies
run: |
go get -d github.com/Masterminds/sprig
- name: Install git2go
run: |
go get -d github.com/libgit2/git2go
cd ./src/github.com/libgit2/git2go
git submodule update --init # get libgit2
cd vendor/libgit2
new-item -Name "build" -ItemType directory
cd build
cmake -DUSE_SSH=OFF -DCMAKE_INSTALL_PREFIX=D:\a\gtm-core\gtm-core\src\github.com\libgit2\git2go\vendor\libgit2\install ..
cmake --build . --target install
- name: Build
run: |
go get -v -d github.com/DEVELOPEST/gtm-core
cd ./src/github.com/DEVELOPEST/gtm-core
new-item -Name "build" -ItemType directory
$env:PKG_CONFIG_PATH += ";D:\a\gtm-core\gtm-core\src\github.com\libgit2\git2go\vendor\libgit2\install\lib\pkgconfig"
go build -o build/ main.go
Copy-Item "D:/a/gtm-core/gtm-core/src/github.com/libgit2/git2go/vendor/libgit2/install/bin/git2.dll" -Destination "./build/git2.dll"
cd build
dir
Rename-Item -Path "main.exe" -NewName "gtm.exe"
- uses: actions/upload-artifact@v2
with:
name: gtm-windows
path: ./src/github.com/${{ github.repository }}/build/
build-macOS:
runs-on: macos-latest
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: auto
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Checkout code
uses: actions/checkout@v2
with:
path: ./src/github.com/${{ github.repository }}
submodules: true
- name: Install brew
run: |
brew install cmake pkg-config libssh2
- name: Install go dependencies
run: |
go get -d github.com/Masterminds/sprig
- name: Install git2go
run: |
go get -d github.com/libgit2/git2go
cd $GOPATH/src/github.com/libgit2/git2go
git submodule update --init # get libgit2
cd vendor/libgit2
mkdir build && cd build
cmake ..
cd ../../..
make install-static
cd $GOPATH
- name: Build
run: |
go get -v -d github.com/DEVELOPEST/gtm-core
cd $GOPATH/src/github.com/DEVELOPEST/gtm-core
mkdir build
go build --tags static -o build/ ./...
cd build/
mv gtm-core gtm
chmod +x gtm
cd $GOPATH
- uses: actions/upload-artifact@v2
with:
name: gtm-macOS
path: ./src/github.com/${{ github.repository }}/build/