Ver código fonte

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
registergoofy 4 anos atrás
pai
commit
10c98b6547

+ 19 - 0
.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 }}

+ 27 - 0
.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 }}

+ 12 - 0
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)