-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (52 loc) · 1.77 KB
/
ci.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
name: Build Filebeat Processors
on:
push:
branches:
- 'master'
jobs:
build:
name: "Build Filebeat"
runs-on: ubuntu-latest
env:
GO111MODULE: 'on'
steps:
- name: Checkout Processors
uses: actions/checkout@v2
with:
repository: 'ytpay/filebeat-processors'
path: 'filebeat-processors'
submodules: 'true'
- name: Read Filebeat Version
run: "echo FILEBEAT_VERSION=$(cat filebeat-version) >> ${GITHUB_ENV}"
working-directory: ./filebeat-processors
- name: Checkout Filebeat
uses: actions/checkout@v2
with:
repository: 'elastic/beats'
ref: "${{ env.FILEBEAT_VERSION }}"
path: 'beats'
submodules: 'true'
- name: "Setup Golang"
uses: actions/setup-go@v2
with:
go-version: '^1.16.0'
- name: "Install gox"
working-directory: "${{ env.GITHUB_WORKSPACE }}"
run: |
go install github.com/mitchellh/gox@latest
- name: "Build Processor"
working-directory: ./beats
run: |
git checkout -b ${FILEBEAT_VERSION} ${FILEBEAT_VERSION}
cat ../filebeat-processors/import.txt >> libbeat/cmd/instance/imports_common.go
go get github.com/ytpay/filebeat-processors@${GITHUB_SHA}
(cd filebeat && make crosscompile && mv build/bin ${GITHUB_WORKSPACE}/artifacts)
echo "ARTIFACTS_PATH=${GITHUB_WORKSPACE}/artifacts/*" >> ${GITHUB_ENV}
- name: "Create Release"
uses: ncipollo/release-action@v1
with:
name: "Bump ${{ env.FILEBEAT_VERSION }}"
tag: "${{ env.FILEBEAT_VERSION }}"
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "${{ env.ARTIFACTS_PATH }}"
allowUpdates: 'true'