-
Notifications
You must be signed in to change notification settings - Fork 75
66 lines (59 loc) · 2.07 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
name: Go
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Test
run: go test ./...
- name: Build
run: |
export GOFLAGS="-buildmode=pie -trimpath"
go version
GOFLAGS="-trimpath" go build -o local-log4j-vuln-scanner ./scanner
GOOS=windows go build -o local-log4j-vuln-scanner.exe ./scanner
GOOS=darwin go build -o local-log4j-vuln-scanner.macosx ./scanner
GOFLAGS="-trimpath" go build -o local-log4j-vuln-patcher ./patcher
GOOS=windows go build -o local-log4j-vuln-patcher.exe ./patcher
GOOS=darwin go build -o local-log4j-vuln-patcher.macosx ./patcher
sha256sum \
local-log4j-vuln-scanner \
local-log4j-vuln-scanner.exe \
local-log4j-vuln-scanner.macosx \
local-log4j-vuln-patcher \
local-log4j-vuln-patcher.exe \
local-log4j-vuln-patcher.macosx \
| awk 'BEGIN { print "# Binaries" } /^([0-9a-f]*) (.*)$/ { print "- "$2": sha256="$1 }' \
> relnotes.txt
- name: Upload artifact
uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/heads/')
with:
name: my-artifact
path: |
local-log4j-vuln-scanner
local-log4j-vuln-scanner.exe
local-log4j-vuln-scanner.macosx
local-log4j-vuln-patcher
local-log4j-vuln-patcher.exe
local-log4j-vuln-patcher.macosx
relnotes.txt
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: relnotes.txt
files: |
local-log4j-vuln-scanner
local-log4j-vuln-scanner.exe
local-log4j-vuln-scanner.macosx
local-log4j-vuln-patcher
local-log4j-vuln-patcher.exe
local-log4j-vuln-patcher.macosx
README.md
LICENSE