-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (51 loc) · 1.49 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
name: release version tag
on:
push:
tags: [ "v*.*.*" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
- os: macos-latest
goos: darwin
steps:
- name: checkout
uses: actions/checkout@v3
- name: install libpcap
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libpcap-dev
- name: setup go
uses: actions/setup-go@v3
with:
go-version: '1.20'
- name: test before release
run: go test ./...
- name: build binary
run: go build -o flowpipeline-${{ matrix.goos }} -ldflags "-X main.Version=${{ github.ref_name }}" .
- name: build statically linked
run: go build -o flowpipeline-${{ matrix.goos }}-static -ldflags "-X main.Version=${{ github.ref_name }}" .
env:
CGO_ENABLED: 0
- name: save statically linked binary
uses: actions/upload-artifact@v3
with:
name: flowpipeline
path: ./flowpipeline-*
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: get binaries from previous job
uses: actions/download-artifact@v3
- name: display downloaded files
run: ls -R
- name: release with binaries
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
prerelease: ${{ endsWith(github.ref, '-alpha') || endsWith(github.ref, '-beta') }}
files: "flowpipeline/flowpipeline-*"