-
Notifications
You must be signed in to change notification settings - Fork 27
145 lines (127 loc) · 4.75 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
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
name: Go
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Set up Go 1.xx
uses: actions/setup-go@v5
with:
go-version: ^1.21
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Create Output Directory
run: mkdir -p .release
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build Linux 64
run: go build -mod=vendor -a -ldflags "-X main.OECCommitVersion=$GITHUB_SHA -X main.OECVersion=${{ github.event.inputs.version }}" -o ../.release/oec-packages-linux/OpsgenieEdgeConnector main.go
working-directory: main
if: success()
env:
CGO_ENABLED: 0
GOOS: linux
GOARCH: amd64
GO111MODULE: on
- uses: montudor/[email protected]
name: Compressing Linux Package
with:
args: zip -qq -j -r .release/oec-linux-amd64-${{ github.event.inputs.version }}.zip .release/oec-packages-linux/
- name: Build Win 32 Service
run: go build -mod=vendor -o ../../.release/oec-packages-win32/oecService32.exe oecService.go
working-directory: windows_service/main
if: success()
env:
CGO_ENABLED: 0
GOOS: windows
GOARCH: 386
GO111MODULE: on
- name: Build Win 32
run: go build -mod=vendor -a -ldflags "-X main.OECCommitVersion=$GITHUB_SHA -X main.OECVersion=${{ github.event.inputs.version }}" -o ../.release/oec-packages-win32/OpsgenieEdgeConnector32.exe main.go
working-directory: main
if: success()
env:
CGO_ENABLED: 0
GOOS: windows
GOARCH: 386
GO111MODULE: on
- uses: montudor/[email protected]
name: Compressing Windows 32 Package
with:
args: zip -qq -j -r .release/oec-win-386-${{ github.event.inputs.version }}.zip .release/oec-packages-win32/
- name: Build Win 64 Service
run: go build -mod=vendor -o ../../.release/oec-packages-win64/oecService64.exe oecService.go
working-directory: windows_service/main
if: success()
env:
CGO_ENABLED: 0
GOOS: windows
GOARCH: amd64
GO111MODULE: on
- name: Build Win 64
run: go build -mod=vendor -a -ldflags "-X main.OECCommitVersion=$GITHUB_SHA -X main.OECVersion=${{ github.event.inputs.version }}" -o ../.release/oec-packages-win64/OpsgenieEdgeConnector64.exe main.go
working-directory: main
if: success()
env:
CGO_ENABLED: 0
GOOS: windows
GOARCH: amd64
GO111MODULE: on
- uses: montudor/[email protected]
name: Compressing Windows 64 Package
with:
args: zip -qq -j -r .release/oec-win-amd64-${{ github.event.inputs.version }}.zip .release/oec-packages-win64/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: true
- name: Upload Linux 64 bit Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .release/oec-linux-amd64-${{ github.event.inputs.version }}.zip
asset_name: oec-linux-amd64-${{ github.event.inputs.version }}.zip
asset_content_type: application/zip
- name: Upload Win 32 bit Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .release/oec-win-386-${{ github.event.inputs.version }}.zip
asset_name: oec-win-386-${{ github.event.inputs.version }}.zip
asset_content_type: application/zip
- name: Upload Win 64 bit Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .release/oec-win-amd64-${{ github.event.inputs.version }}.zip
asset_name: oec-win-amd64-${{ github.event.inputs.version }}.zip
asset_content_type: application/zip
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Release Artifacts
path: .release/**