crowdsec/.github/workflows/build-binary-package.yml
Thibault bui Koechlin 68b12161b2 actions
2020-05-15 11:41:18 +02:00

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 }}