From b20df6060620fa4e35b199d6aa918f301b70dde6 Mon Sep 17 00:00:00 2001 From: Guangning Date: Thu, 25 Jun 2020 14:26:34 +0800 Subject: [PATCH] Support elastic beat release (#23) Support elastic beat release --- .github/workflows/release.yml | 51 +++++++++++++ .gitignore | 1 + .goreleaser.yml | 75 +++++++++++++++++++ auditbeat.go => auditbeat/auditbeat.go | 0 docs/release-header.md | 0 docs/release-note.md | 0 filebeat.go => filebeat/filebeat.go | 0 .../functionbeat.go | 0 journalbeat.go => journalbeat/journalbeat.go | 0 metricbeat.go => metricbeat/metricbeat.go | 0 packetbeat.go => packetbeat/packetbeat.go | 0 winlogbeat.go => winlogbeat/winlogbeat.go | 0 12 files changed, 127 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml rename auditbeat.go => auditbeat/auditbeat.go (100%) create mode 100644 docs/release-header.md create mode 100644 docs/release-note.md rename filebeat.go => filebeat/filebeat.go (100%) rename functionbeat.go => functionbeat/functionbeat.go (100%) rename journalbeat.go => journalbeat/journalbeat.go (100%) rename metricbeat.go => metricbeat/metricbeat.go (100%) rename packetbeat.go => packetbeat/packetbeat.go (100%) rename winlogbeat.go => winlogbeat/winlogbeat.go (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..5c5c92c9c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: elastic beat release by goreleaser + +on: + push: + tags: + - '*' + +env: + GOPRIVATE: github.com/streamnative + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: 1.13.x + + - + name: Create go path directory + env: + GOPATH: /home/runner/work/pulsar-beat-output/pulsar-beat-output/go + run: | + mkdir -p $GOPATH/src/github.com/streamnative/ + + - + name: Checkout + uses: actions/checkout@v2 + with: + path: go/src/github.com/streamnative/pulsar-beat-output + + - + name: Unshallow + run: | + mkdir -p go/src/github.com/streamnative/pulsar-beat-output + cd /home/runner/work/pulsar-beat-output/pulsar-beat-output/go/src/github.com/streamnative/pulsar-beat-output && + git fetch --prune --unshallow + + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2.1.1 + with: + workdir: /home/runner/work/pulsar-beat-output/pulsar-beat-output/go/src/github.com/streamnative/pulsar-beat-output + version: latest + args: release --rm-dist --release-notes=docs/release-note.md --release-header=docs/release-header.md + env: + GITHUB_TOKEN: ${{ secrets.BEAT_ACCESS_TOKEN }} + GOPATH: /home/runner/work/pulsar-beat-output/pulsar-beat-output/go + \ No newline at end of file diff --git a/.gitignore b/.gitignore index 356cd789f..98542299f 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ beat.db data/* logs/* +dist diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 000000000..a85b490c3 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,75 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +project_name: beat +builds: + - + id: "fielbeat" + binary: filebeat + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - 386 + - amd64 + main: ./filebeat/filebeat.go + - + id: "auditbeat" + env: + - CGO_ENABLED=0 + binary: auditbeat + goos: + - linux + - darwin + goarch: + - 386 + - amd64 + main: ./auditbeat/auditbeat.go + - + id: "functionbeat" + env: + - CGO_ENABLED=0 + binary: functionbeat + goos: + - linux + - darwin + goarch: + - 386 + - amd64 + main: ./functionbeat/functionbeat.go + - + id: "journalbeat" + env: + - CGO_ENABLED=0 + binary: journalbeat + goos: + - linux + - darwin + goarch: + - 386 + - amd64 + main: ./journalbeat/journalbeat.go + - + id: "winlogbeat" + env: + - CGO_ENABLED=0 + binary: winlogbeat + goos: + - linux + - darwin + goarch: + - 386 + - amd64 + main: ./winlogbeat/winlogbeat.go + +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' \ No newline at end of file diff --git a/auditbeat.go b/auditbeat/auditbeat.go similarity index 100% rename from auditbeat.go rename to auditbeat/auditbeat.go diff --git a/docs/release-header.md b/docs/release-header.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/release-note.md b/docs/release-note.md new file mode 100644 index 000000000..e69de29bb diff --git a/filebeat.go b/filebeat/filebeat.go similarity index 100% rename from filebeat.go rename to filebeat/filebeat.go diff --git a/functionbeat.go b/functionbeat/functionbeat.go similarity index 100% rename from functionbeat.go rename to functionbeat/functionbeat.go diff --git a/journalbeat.go b/journalbeat/journalbeat.go similarity index 100% rename from journalbeat.go rename to journalbeat/journalbeat.go diff --git a/metricbeat.go b/metricbeat/metricbeat.go similarity index 100% rename from metricbeat.go rename to metricbeat/metricbeat.go diff --git a/packetbeat.go b/packetbeat/packetbeat.go similarity index 100% rename from packetbeat.go rename to packetbeat/packetbeat.go diff --git a/winlogbeat.go b/winlogbeat/winlogbeat.go similarity index 100% rename from winlogbeat.go rename to winlogbeat/winlogbeat.go