Skip to content

Commit

Permalink
new: release a docker image too.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed May 6, 2024
1 parent e3568c2 commit f1049bc
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 7 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,44 @@ jobs:
run: sudo apt-get install -y libsodium-dev

- name: Setup Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version-file: 'go.mod'

- name: Build
run: make build

- name: Test
run: make test

gomodtidy:
name: Enforce go.mod tidiness
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
ref: "${{ github.event.pull_request.head.sha }}"
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- name: Execute go mod tidy and check the outcome
working-directory: ./
run: |
go mod tidy
exit_code=$(git diff --exit-code)
exit ${exit_code}
- name: Print a comment in case of failure
run: |
echo "The go.mod and/or go.sum files appear not to be correctly tidied.
Please, rerun go mod tidy to fix the issues."
exit 1
if: |
failure() && github.event.pull_request.head.repo.full_name == github.repository
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- name: Install sodium
run: sudo apt-get install -y libsodium-dev
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build/
pigeon
.idea/
8 changes: 6 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project_name: pigeon
builds:
- id: "pigeon"
- id: "{{.ProjectName}}"
goos:
- linux
goarch:
Expand All @@ -9,7 +9,11 @@ builds:
flags:
- -v
- -buildmode=pie
binary: pigeon
binary: "{{.ProjectName}}"

dockers:
- image_templates:
- "ghcr.io/falcosecurity/{{.ProjectName}}"

release:
github:
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ubuntu:24.04

RUN apt update && apt install -y libsodium-dev

ENTRYPOINT ["/pigeon"]
COPY pigeon /
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pigeon ?= build/pigeon
pigeon ?= pigeon

.PHONY: build
build: clean ${pigeon}

.PHONY: clean
clean:
$(RM) -R dist
$(RM) -R build
$(RM) -R ${pigeon}

${pigeon}:
go build -buildmode=pie -o $@ .
Expand Down

0 comments on commit f1049bc

Please sign in to comment.