diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2c1b5aab..4c17737a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,6 +36,10 @@ jobs: username: ${{github.actor}} password: ${{secrets.GITHUB_TOKEN}} + - name: "Print environment" + run: | + env | sort + - name: "Release Version" if: success() && startsWith(github.ref, 'refs/tags/v') uses: goreleaser/goreleaser-action@v6 diff --git a/.goreleaser.yml b/.goreleaser.yml index 42b93b27..c9a5554d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -28,6 +28,8 @@ builds: - -X go.fd.io/govpp/version.commit={{.FullCommit}} - -X go.fd.io/govpp/version.branch={{.Branch}} - -X go.fd.io/govpp/version.buildStamp={{.Timestamp}} + - -X go.fd.io/govpp/version.buildUser={{if index .Env "USER"}}{{.Env.USER}}{{else}}goreleaser{{end}} + - -X go.fd.io/govpp/version.buildHost={{if index .Env "HOSTNAME"}}{{.Env.HOSTNAME}}{{else}}goreleaser{{end}} archives: - id: govpp-archive @@ -53,10 +55,11 @@ changelog: dockers: - dockerfile: Dockerfile.govpp + skip_push: auto image_templates: - "ghcr.io/fdio/govpp:{{ .Tag }}" - - "ghcr.io/fdio/govpp:v{{ .Major }}.{{ .Minor }}" - - "ghcr.io/fdio/govpp:latest" + - "{{if not .Prerelease}}ghcr.io/fdio/govpp:v{{ .Major }}.{{ .Minor }}{{end}}" + - "{{if not .Prerelease}}ghcr.io/fdio/govpp:latest{{end}}" build_flag_templates: - "--pull" - "--label=org.opencontainers.image.created={{.Date}}" diff --git a/Dockerfile.govpp b/Dockerfile.govpp index b7e3bd84..e30a03b8 100644 --- a/Dockerfile.govpp +++ b/Dockerfile.govpp @@ -1,3 +1,13 @@ -FROM scratch +FROM alpine:3.20 + +RUN set -eux; \ + apk add --no-cache \ + bash \ + git \ + make \ + python3 \ + py3-ply + COPY govpp / + ENTRYPOINT ["/govpp"] diff --git a/Makefile b/Makefile index 5e93b17a..6ab70b92 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,15 @@ install-proxy: ## Install vpp-proxy @echo "# installing vpp-proxy ${VERSION}" @go install ${GO_BUILD_ARGS} ./cmd/vpp-proxy +.PHONY: install-goreleaser +install-goreleaser: ## Install goreleaser + @echo "# installing goreleaser" + @go install github.com/goreleaser/goreleaser/v2@latest + +.PHONY: release-snapshot +release-snapshot: ## Release snapshot + @goreleaser release --clean --snapshot + .PHONY: generate generate: generate-binapi ## Generate all