diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70a856e..0746e03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,13 @@ jobs: with: go-version: ^1.19 cache: true + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Run GoReleaser uses: goreleaser/goreleaser-action@v3 diff --git a/.gitignore b/.gitignore index 1c3d73f..552b813 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ .vscode .idea -build/ \ No newline at end of file +build/ +dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml index bce3970..560adc7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -16,6 +16,7 @@ builds: - darwin goarch: - amd64 + - arm64 archives: - name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" replacements: @@ -46,7 +47,28 @@ changelog: - '^test' release: prerelease: auto - +dockers: + - image_templates: + - "ghcr.io/coreruleset/go-ftw:{{ .Version }}-amd64" + use: buildx + goarch: amd64 + build_flag_templates: + - "--platform=linux/amd64" + - image_templates: + - "ghcr.io/coreruleset/go-ftw:{{ .Version }}-arm64" + use: buildx + goarch: arm64 + build_flag_templates: + - "--platform=linux/arm64" +docker_manifests: + - name_template: "ghcr.io/coreruleset/go-ftw:latest" + image_templates: + - "ghcr.io/coreruleset/go-ftw:{{ .Version }}-amd64" + - "ghcr.io/coreruleset/go-ftw:{{ .Version }}-arm64" + - name_template: "ghcr.io/coreruleset/go-ftw:{{ .Version }}" + image_templates: + - "ghcr.io/coreruleset/go-ftw:{{ .Version }}-amd64" + - "ghcr.io/coreruleset/go-ftw:{{ .Version }}-arm64" nfpms: - id: "ftw" builds: ["ftw"] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..270236d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM alpine:3 + +RUN apk add --no-cache ca-certificates + +ENTRYPOINT ["/ftw"] +COPY ftw /