From 7db703bd0b02a68a3e433cfcce0096ae06cad7f0 Mon Sep 17 00:00:00 2001 From: Alexander Sporn Date: Fri, 16 Feb 2024 11:25:28 +0100 Subject: [PATCH 1/2] Add a BUILD_VERSION arg to the Dockerfile and pass the github.ref when releasing --- .github/workflows/release.yml | 3 +++ Dockerfile | 3 ++- components/app/app.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 096b4d33f..e6eb5bdcc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,7 @@ name: Release on: release: types: [published] + workflow_dispatch: jobs: docker: @@ -43,4 +44,6 @@ jobs: file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true + build-args: | + BUILD_VERSION=${{ github.ref }} tags: ${{ steps.meta.outputs.tags }} diff --git a/Dockerfile b/Dockerfile index 41594b947..7425aab20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM golang:1.21-bookworm AS build ARG BUILD_TAGS=rocksdb +ARG BUILD_VERSION=v1.0.0-develop LABEL org.label-schema.description="IOTA core node" LABEL org.label-schema.name="iotaledger/iota-core" @@ -28,7 +29,7 @@ RUN go mod download RUN go mod verify # Build the binary -RUN go build -o /app/iota-core -tags="$BUILD_TAGS" -ldflags='-w -s' +RUN go build -o /app/iota-core -tags="$BUILD_TAGS" -ldflags="-w -s -X=github.com/iotaledger/iota-core/components/app.Version=${BUILD_VERSION}" # Copy the assets RUN cp ./config_defaults.json /app/config.json diff --git a/components/app/app.go b/components/app/app.go index 96a1cf355..901186694 100644 --- a/components/app/app.go +++ b/components/app/app.go @@ -25,7 +25,7 @@ var ( Name = "iota-core" // Version of the app. - Version = "1.0.0-alpha.6" + Version = "v1.0.0-develop" ) func App() *app.App { From c8bf0c52e6c210c2a6316553fb576b0ba68ebc2e Mon Sep 17 00:00:00 2001 From: Alexander Sporn Date: Fri, 16 Feb 2024 13:53:13 +0100 Subject: [PATCH 2/2] Use our fork of the typegroupingcheck linter --- .github/workflows/golangci-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index d7e8c131a..a8fcef49c 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -18,8 +18,8 @@ jobs: - name: Checkout custom linter uses: actions/checkout@v4 with: - repository: muxxer/typegroupingcheck - path: typegroupingcheck + repository: iotaledger/typegroupingcheck + path: typegroupingcheck - name: Setup go uses: actions/setup-go@v5