From 405a2edc29383258abb2b8d49ace79395f4258b0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:35:49 +0000 Subject: [PATCH 1/4] chore(deps): update mccutchen/go-httpbin docker tag to v2.15.0 --- example/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/docker-compose.yaml b/example/docker-compose.yaml index e507fd4..d6740be 100644 --- a/example/docker-compose.yaml +++ b/example/docker-compose.yaml @@ -1,7 +1,7 @@ version: "3.9" services: httpbin: - image: mccutchen/go-httpbin:v2.13.4 + image: mccutchen/go-httpbin:v2.15.0 environment: - MAX_BODY_SIZE=15728640 # 15 MiB command: [ "/bin/go-httpbin", "-port", "8081" ] From 5dba63d9522688884cdad71c4d5ac643a698742c Mon Sep 17 00:00:00 2001 From: Fionera Date: Mon, 25 Nov 2024 20:42:12 +0100 Subject: [PATCH 2/4] fix(ci): set correct build output dir --- .github/workflows/package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 10b6580..e6b2f7b 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -59,7 +59,7 @@ jobs: --deb-systemd ./contrib/coraza-spoa.service \ --deb-systemd-enable \ --config-files /etc/coraza-spoa/config.yaml \ - ./coraza-spoa=/usr/bin/coraza-spoa \ + ./build/coraza-spoa=/usr/bin/coraza-spoa \ ./LICENSE=/usr/share/doc/coraza-spoa/ \ ./example/coraza-spoa.yaml=/etc/coraza-spoa/config.yaml From e8f614ba55f49dbf965e7f10c90edb54d37dc9dd Mon Sep 17 00:00:00 2001 From: Fionera Date: Mon, 25 Nov 2024 21:33:39 +0100 Subject: [PATCH 3/4] fix(ci): run build on all branches --- .github/workflows/package.yaml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index e6b2f7b..7a1d7dd 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -4,7 +4,7 @@ name: Package Build on: push: branches: - - main + - '**' tags: - 'v*.*.*' @@ -49,23 +49,23 @@ jobs: - name: Build package run: | - fpm -s dir -t deb -a ${{ matrix.arch }} -n coraza-spoa -v $PACKAGE_VERSION \ - --description "Coraza HAProxy SPOA" \ - --url "https://www.coraza.io" \ - --maintainer "OWASP Coraza Team" \ - --license Apache-2.0 \ - --vendor OWASP \ - --after-install ./contrib/coraza-spoa.postinst \ - --deb-systemd ./contrib/coraza-spoa.service \ - --deb-systemd-enable \ - --config-files /etc/coraza-spoa/config.yaml \ - ./build/coraza-spoa=/usr/bin/coraza-spoa \ - ./LICENSE=/usr/share/doc/coraza-spoa/ \ - ./example/coraza-spoa.yaml=/etc/coraza-spoa/config.yaml + fpm -s dir -t deb -a ${{ matrix.arch }} -n coraza-spoa -v $PACKAGE_VERSION \ + --description "Coraza HAProxy SPOA" \ + --url "https://www.coraza.io" \ + --maintainer "OWASP Coraza Team" \ + --license Apache-2.0 \ + --vendor OWASP \ + --after-install ./contrib/coraza-spoa.postinst \ + --deb-systemd ./contrib/coraza-spoa.service \ + --deb-systemd-enable \ + --config-files /etc/coraza-spoa/config.yaml \ + ./build/coraza-spoa=/usr/bin/coraza-spoa \ + ./LICENSE=/usr/share/doc/coraza-spoa/ \ + ./example/coraza-spoa.yaml=/etc/coraza-spoa/config.yaml ## Publish to the "testing" repo - name: Cloudsmith Push:debian/coraza-spoa-snapshots - if: ${{ github.ref_type == 'branch' }} + if: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }} uses: cloudsmith-io/action@master with: api-key: ${{ secrets.CLOUDSMITH_API_KEY }} From 8482824b360c5d29c0d85296b55dfb22322c7439 Mon Sep 17 00:00:00 2001 From: Fionera Date: Mon, 25 Nov 2024 21:48:56 +0100 Subject: [PATCH 4/4] fix(build): set arch in magefile --- .github/workflows/package.yaml | 2 +- magefile.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 7a1d7dd..3616ef0 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -45,7 +45,7 @@ jobs: sudo apt update && sudo apt -y install make pkg-config rubygems && sudo gem install fpm - name: Build binary - run: VERSION=${PACKAGE_VERSION} GOARCH=${{ matrix.arch }} go run mage.go build + run: VERSION=${PACKAGE_VERSION} ARCH=${{ matrix.arch }} go run mage.go build - name: Build package run: | diff --git a/magefile.go b/magefile.go index 3636167..f8ecfb5 100644 --- a/magefile.go +++ b/magefile.go @@ -13,6 +13,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "github.com/magefile/mage/mg" "github.com/magefile/mage/sh" @@ -56,7 +57,12 @@ func Format() error { } func Build() error { - if err := sh.RunV("go", "build", "-o", "build/coraza-spoa"); err != nil { + arch := os.Getenv("ARCH") + if arch == "" { + arch = runtime.GOARCH + } + + if err := sh.RunWith(map[string]string{"GOARCH": arch}, "go", "build", "-o", "build/coraza-spoa"); err != nil { return err } return nil