From 10c98b654790f96d9a91fbcb717c89ce8cc02714 Mon Sep 17 00:00:00 2001 From: registergoofy <70151212+registergoofy@users.noreply.github.com> Date: Wed, 7 Apr 2021 10:14:39 +0200 Subject: [PATCH] Static release (#737) * dispatch on tag creation * add static build to release * fix static release tarball name * This should be removed once merged and static release file built --- .github/workflows/release_publish-package.yml | 19 +++++++++++++ .../workflows/tmp_build_static_release.yml | 27 +++++++++++++++++++ Makefile | 12 +++++++++ 3 files changed, 58 insertions(+) create mode 100644 .github/workflows/tmp_build_static_release.yml diff --git a/.github/workflows/release_publish-package.yml b/.github/workflows/release_publish-package.yml index de262be86..8975521fc 100644 --- a/.github/workflows/release_publish-package.yml +++ b/.github/workflows/release_publish-package.yml @@ -25,3 +25,22 @@ jobs: args: crowdsec-release.tgz application/x-gzip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + build_static: + 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: Build the binaries + run: make release_static + - 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 }} diff --git a/.github/workflows/tmp_build_static_release.yml b/.github/workflows/tmp_build_static_release.yml new file mode 100644 index 000000000..0bd1c9c47 --- /dev/null +++ b/.github/workflows/tmp_build_static_release.yml @@ -0,0 +1,27 @@ +# .github/workflows/build-docker-image.yml +name: tmp_one_shot_build + +on: + push: + branches: [ master ] + +jobs: + build_static: + 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: Build the binaries + run: make release_static + - 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 }} diff --git a/Makefile b/Makefile index de3579728..d8ef37542 100644 --- a/Makefile +++ b/Makefile @@ -124,3 +124,15 @@ release: check_release build @cp wizard.sh $(RELDIR) @cp scripts/test_env.sh $(RELDIR) @tar cvzf crowdsec-release.tgz $(RELDIR) + +.PHONY: +release_static: check_release static + @echo Building Release to dir $(RELDIR) + @mkdir -p $(RELDIR)/cmd/crowdsec + @mkdir -p $(RELDIR)/cmd/crowdsec-cli + @cp $(CROWDSEC_FOLDER)/$(CROWDSEC_BIN) $(RELDIR)/cmd/crowdsec + @cp $(CSCLI_FOLDER)/$(CSCLI_BIN) $(RELDIR)/cmd/crowdsec-cli + @cp -R ./config/ $(RELDIR) + @cp wizard.sh $(RELDIR) + @cp scripts/test_env.sh $(RELDIR) + @tar cvzf crowdsec-release-static.tgz $(RELDIR)