2020-05-15 09:41:18 +00:00
|
|
|
# .github/workflows/build-docker-image.yml
|
2020-07-27 10:18:55 +00:00
|
|
|
name: build
|
2020-05-15 09:41:18 +00:00
|
|
|
|
2022-06-17 14:12:49 +00:00
|
|
|
on:
|
2020-05-15 09:41:18 +00:00
|
|
|
release:
|
|
|
|
types: prereleased
|
|
|
|
|
|
|
|
jobs:
|
2020-07-27 10:18:55 +00:00
|
|
|
build:
|
2020-05-15 09:41:18 +00:00
|
|
|
name: Build and upload binary package
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-08-26 11:31:49 +00:00
|
|
|
- name: Set up Go 1.19
|
2022-04-05 09:00:11 +00:00
|
|
|
uses: actions/setup-go@v3
|
2020-05-15 09:41:18 +00:00
|
|
|
with:
|
2022-08-26 11:31:49 +00:00
|
|
|
go-version: 1.19
|
2020-05-15 09:41:18 +00:00
|
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
2022-04-05 09:00:11 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-05-15 09:41:18 +00:00
|
|
|
- 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 }}
|
2021-04-07 08:14:39 +00:00
|
|
|
build_static:
|
|
|
|
name: Build and upload binary package
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-08-26 11:31:49 +00:00
|
|
|
- name: Set up Go 1.19
|
2022-10-14 14:12:21 +00:00
|
|
|
uses: actions/setup-go@v3
|
2021-04-07 08:14:39 +00:00
|
|
|
with:
|
2022-08-26 11:31:49 +00:00
|
|
|
go-version: 1.19
|
2021-04-07 08:14:39 +00:00
|
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
2022-04-05 09:00:11 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-04-07 08:14:39 +00:00
|
|
|
- name: Build the binaries
|
2022-09-14 12:22:57 +00:00
|
|
|
run: |
|
|
|
|
make release BUILD_STATIC=yes
|
2022-11-24 09:29:17 +00:00
|
|
|
mv crowdsec-release.tgz crowdsec-release-static.tgz
|
2021-04-07 08:14:39 +00:00
|
|
|
- name: Upload to release
|
|
|
|
uses: JasonEtco/upload-to-release@master
|
|
|
|
with:
|
|
|
|
args: crowdsec-release-static.tgz application/x-gzip
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|