32 lines
1 KiB
YAML
32 lines
1 KiB
YAML
# .github/workflows/build-docker-image.yml
|
|
name: build-binary-package
|
|
|
|
on:
|
|
release:
|
|
types: prereleased
|
|
|
|
jobs:
|
|
build-binary-package:
|
|
name: Build and upload binary package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go 1.13
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.13
|
|
id: go
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
- name: Check tag == json version
|
|
run: |
|
|
jsonver=$(cat RELEASE.json | jq -r .Version)
|
|
lasttag=$(git for-each-ref --sort=-v:refname --count=1 --format '%(refname)' | cut -d '/' -f3)
|
|
if [ ${jsonver} != ${lasttag} ] ; then echo "version mismatch : ${jsonver} in json, ${lasttag} in git" ; exit 2 ; else echo "${jsonver} == ${lasttag}" ; fi
|
|
- name: Build the binaries
|
|
run: make release
|
|
- name: Upload to release
|
|
uses: JasonEtco/upload-to-release@master
|
|
with:
|
|
args: crowdsec-release.tgz application/x-gzip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|