-
Notifications
You must be signed in to change notification settings - Fork 15
71 lines (67 loc) · 1.63 KB
/
release.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
name: Release OXID
on:
push:
branches:
- 'release**'
- 'main'
release:
types: [ published ]
permissions:
contents: read
jobs:
build-cli:
name: Build cli
strategy:
fail-fast: true
matrix:
include:
- os: windows
arch: amd64
output: OXID-windows-amd64.exe
- os: darwin
arch: amd64
output: OXID-darwin-amd64
- os: darwin
arch: arm64
output: OXID-darwin-arm64
- os: linux
arch: amd64
output: OXID-linux-amd64
- os: linux
arch: arm64
output: OXID-linux-arm64
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version: 1.19
- run: go build -trimpath -ldflags "-w -s -extldflags '-static'" -o target/${{ matrix.output }}
- uses: actions/upload-artifact@v3
with:
name: target
path: target/*
upload-release:
name: Release
needs: [ build-cli ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: target
path: target
- run: ls -al target && ls -R target/ && file target/
# release assets
- uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
with:
files: target/*