-
Notifications
You must be signed in to change notification settings - Fork 9
106 lines (94 loc) · 3.03 KB
/
main.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
name: main
on:
push:
pull_request:
release:
types: [created]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.17
id: go
- uses: dominikh/[email protected]
with:
version: "2022.1"
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Lint, test and build
run: |
# Lint and format
make lint
make format
# Exit if after formatting there are any code differences
git diff --exit-code
# Run tests
make test
# Build and package
if [ ${{ github.event_name }} == "release" ]; then
VERSION="${{ github.event.release.tag_name }}"
else
VERSION=$(git rev-parse --short ${{ github.sha }})
fi
make VERSION="${VERSION}"
make zip
- name: Publish linux 386
if: github.event_name == 'release'
uses: Shopify/[email protected]
with:
name: simple-proxy_linux_386.zip
path: dist/simple-proxy_linux_386.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish linux amd64
if: github.event_name == 'release'
uses: Shopify/[email protected]
with:
name: simple-proxy_linux_amd64.zip
path: dist/simple-proxy_linux_amd64.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish linux arm
if: github.event_name == 'release'
uses: Shopify/[email protected]
with:
name: simple-proxy_linux_arm.zip
path: dist/simple-proxy_linux_arm.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish linux arm64
if: github.event_name == 'release'
uses: Shopify/[email protected]
with:
name: simple-proxy_linux_arm64.zip
path: dist/simple-proxy_linux_arm64.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish darwin amd64
if: github.event_name == 'release'
uses: Shopify/[email protected]
with:
name: simple-proxy_darwin_amd64.zip
path: dist/simple-proxy_darwin_amd64.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish darwin arm64
if: github.event_name == 'release'
uses: Shopify/[email protected]
with:
name: simple-proxy_darwin_arm64.zip
path: dist/simple-proxy_darwin_arm64.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish windows 386
if: github.event_name == 'release'
uses: Shopify/[email protected]
with:
name: simple-proxy_windows_386.zip
path: dist/simple-proxy_windows_386.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish windows amd64
if: github.event_name == 'release'
uses: Shopify/[email protected]
with:
name: simple-proxy_windows_amd64.zip
path: dist/simple-proxy_windows_amd64.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}