Skip to content

Commit

Permalink
Merge pull request #745 from iotaledger/feat/gh-release-tag
Browse files Browse the repository at this point in the history
Add a BUILD_VERSION arg to the Dockerfile and pass the github.ref when releasing
  • Loading branch information
alexsporn authored Feb 16, 2024
2 parents b89d5a8 + c8bf0c5 commit d66cc4e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Release
on:
release:
types: [published]
workflow_dispatch:

jobs:
docker:
Expand Down Expand Up @@ -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 }}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion components/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d66cc4e

Please sign in to comment.