2020-05-15 09:41:18 +00:00
|
|
|
# .github/workflows/build-docker-image.yml
|
2024-01-30 09:20:25 +00:00
|
|
|
name: Release
|
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:
|
2022-12-21 19:34:11 +00:00
|
|
|
types:
|
|
|
|
- prereleased
|
2020-05-15 09:41:18 +00:00
|
|
|
|
2023-05-30 08:47:04 +00:00
|
|
|
permissions:
|
|
|
|
# Use write for: hub release edit
|
|
|
|
contents: write
|
|
|
|
|
2020-05-15 09:41:18 +00:00
|
|
|
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:
|
2023-03-08 13:50:59 +00:00
|
|
|
|
2022-12-21 19:34:11 +00:00
|
|
|
- name: Check out code into the Go module directory
|
2024-01-30 09:20:25 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-01-13 13:16:17 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-02-28 16:25:09 +00:00
|
|
|
submodules: false
|
|
|
|
|
2024-01-30 09:20:25 +00:00
|
|
|
- name: "Set up Go"
|
|
|
|
uses: actions/setup-go@v5
|
2023-02-28 16:25:09 +00:00
|
|
|
with:
|
2024-03-19 09:03:54 +00:00
|
|
|
go-version: "1.21.8"
|
2023-02-28 16:25:09 +00:00
|
|
|
|
2022-12-21 19:34:11 +00:00
|
|
|
- name: Build the binaries
|
2023-06-23 12:25:29 +00:00
|
|
|
run: |
|
|
|
|
sudo apt -qq -y -o=Dpkg::Use-Pty=0 install build-essential libre2-dev
|
|
|
|
make vendor release BUILD_STATIC=1
|
2023-03-08 13:50:59 +00:00
|
|
|
|
2022-12-21 19:34:11 +00:00
|
|
|
- name: Upload to release
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-05-30 08:47:04 +00:00
|
|
|
run: |
|
|
|
|
tag_name="${GITHUB_REF##*/}"
|
2023-10-25 12:51:36 +00:00
|
|
|
gh release upload "$tag_name" crowdsec-release.tgz vendor.tgz *-vendor.tar.xz
|