-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (139 loc) · 4.86 KB
/
artifacts.yaml
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
153
154
155
name: Release
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for release'
required: false
default: master
push:
branches:
- master
tags:
- v*
jobs:
goartifacts:
name: artifacts
strategy:
matrix:
go-version: [1.19.1]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Install go dependencies
run: go mod tidy
- name: Build artifacts
id: build
run: |
make build-artifacts
printf '::set-output name=version::%s\n' "$(./dist/utg_linux_amd64 version | head -n 4)"
- name: 'Upload macOS artifact'
uses: actions/upload-artifact@v2
with:
name: utg_darwin_amd64
path: ./dist/utg_darwin_amd64
retention-days: 1
- name: 'Upload linux/amd64 artifact'
uses: actions/upload-artifact@v2
with:
name: utg_linux_amd64
path: ./dist/utg_linux_amd64
retention-days: 1
- name: 'Upload windows/amd64 artifact'
uses: actions/upload-artifact@v2
with:
name: utg_windows_amd64
path: ./dist/utg_windows_amd64.exe
retention-days: 1
- name: 'Upload linux/arm artifact'
uses: actions/upload-artifact@v2
with:
name: utg_linux_arm
path: ./dist/utg_linux_arm
retention-days: 1
publish:
needs: [goartifacts]
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- uses: actions/download-artifact@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
- if: github.event_name == 'schedule'
run: echo 'TAG_NAME=master' >> $GITHUB_ENV
- if: github.event_name == 'push'
run: |
TAG_NAME=${{ github.ref }}
echo "TAG_NAME=${TAG_NAME#refs/*/}" >> $GITHUB_ENV
- name: Generate Linux-64 SHA256 checksums
run: |
sha256sum utg_linux_amd64/utg_linux_amd64 > utg_linux_amd64.sha256sum
echo "SHA_LINUX_64=$(cat utg_linux_amd64.sha256sum)" >> $GITHUB_ENV
- name: Generate Windows-64 SHA256 checksums
run: |
sha256sum utg_windows_amd64/utg_windows_amd64.exe > utg_windows_amd64.sha256sum
echo "SHA_WINDOWS_64=$(cat utg_windows_amd64.sha256sum)" >> $GITHUB_ENV
- name: Generate macOS SHA256 checksums
run: |
sha256sum utg_darwin_amd64/utg_darwin_amd64 > utg_darwin_amd64.sha256sum
echo "SHA_MACOS=$(cat utg_darwin_amd64.sha256sum)" >> $GITHUB_ENV
- name: Generate Linux-ARM SHA256 checksums
run: |
sha256sum utg_linux_arm/utg_linux_arm > utg_linux_arm.sha256sum
echo "SHA_LINUX_ARM=$(cat utg_linux_arm.sha256sum)" >> $GITHUB_ENV
- if: env.TAG_NAME == 'master'
run: echo 'SUBJECT=UDP2gRPC development (prerelease) build' >> $GITHUB_ENV
- if: env.TAG_NAME != 'master'
run: echo 'SUBJECT=UDP2gRPC release build' >> $GITHUB_ENV
- uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.TAG_NAME }}
name: ${{ env.SUBJECT }}
prerelease: ${{ env.TAG_NAME == 'master' }}
commitish: ${{ github.sha }}
gzip: false
allow_override: true
files: |
utg_darwin_amd64:./utg_darwin_amd64/utg_darwin_amd64
utg_darwin_amd64.sha256sum:./utg_darwin_amd64.sha256sum
utg_windows_amd64:./utg_windows_amd64/utg_windows_amd64.exe
utg_windows_amd64.sha256sum:./utg_windows_amd64.sha256sum
utg_linux_amd64:./utg_linux_amd64/utg_linux_amd64
utg_linux_amd64.sha256sum:./utg_linux_amd64.sha256sum
utg_linux_arm:./utg_linux_arm/utg_linux_arm
utg_linux_arm.sha256sum:./utg_linux_arm.sha256sum
body: |
```
${{ needs.goartifacts.outputs.version }}
```
### macOS (x64)
1. Download **utg_darwin_amd64**
2. Run `./utg_darwin_amd64`
### windows (x64)
1. Download **utg_windows_amd64.exe**
2. Run `./utg_windows_amd64.exe`
### Linux (x64)
1. Download **utg_linux_amd64**
2. Run `./utg_linux_amd64`
### Linux (ARM)
1. Download **utg_linux_arm**
2. Run `./utg_linux_arm`
## SHA256 Checksums
```
${{ env.SHA_LINUX_64 }}
${{ env.SHA_MACOS }}
${{ env.SHA_WINDOWS_64 }}
${{ env.SHA_LINUX_ARM }}
```