Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat-validate
Browse files Browse the repository at this point in the history
  • Loading branch information
David Prodinger committed Nov 26, 2024
2 parents 96efa2b + 8482824 commit 3ad2a37
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Package Build
on:
push:
branches:
- main
- '**'
tags:
- 'v*.*.*'

Expand Down Expand Up @@ -45,27 +45,27 @@ 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: |
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 \
./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 }}
Expand Down
2 changes: 1 addition & 1 deletion example/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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" ]
Expand Down
8 changes: 7 additions & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"

"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3ad2a37

Please sign in to comment.