diff --git a/.dockerignore b/.dockerignore index 3907951d3..433260016 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,15 +1,21 @@ -# Ignore everything that starts with a dot -.* -# Readme files and docs -README.rst -README_template.rst -generate_readme.sh -docs -COPYING -# Build file -Dockerfile* -makefile -nuts-node -development +# Only untracked and local files are excluded. Tracked files must stay in the +# build context: go build runs "git status" to stamp the module version from +# the checked-out tag, and marks the version "+dirty" when tracked files are +# missing (see Dockerfile). +# .claude/commands is tracked; only the local parts are excluded. +.claude/worktrees +.claude/settings.local.json +.idea +.run +.DS_Store +**/.DS_Store +CLAUDE-* data -e2e-tests +**/data +docs/_build +*.pem +*.key +*.db +nuts +nuts-node +nuts.yaml diff --git a/.github/workflows/build-binaries.yaml b/.github/workflows/build-binaries.yaml index 6528e5043..49034b737 100644 --- a/.github/workflows/build-binaries.yaml +++ b/.github/workflows/build-binaries.yaml @@ -55,7 +55,7 @@ jobs: - name: Build run: | - GOOS=linux GOARCH=${{ matrix.arch }} go build -o nuts-linux-${{ matrix.arch }} -ldflags="-w -s -X 'github.com/nuts-foundation/nuts-node/v6/core.GitCommit=${GIT_COMMIT}' -X 'github.com/nuts-foundation/nuts-node/v6/core.GitBranch=${GIT_BRANCH}' -X 'github.com/nuts-foundation/nuts-node/v6/core.GitVersion=${GIT_VERSION}'" -o nuts-linux-${{ matrix.arch }} + MODULE=$(go list -m) && GOOS=linux GOARCH=${{ matrix.arch }} go build -ldflags="-w -s -X '${MODULE}/core.GitCommit=${GIT_COMMIT}' -X '${MODULE}/core.GitBranch=${GIT_BRANCH}' -X '${MODULE}/core.GitVersion=${GIT_VERSION}'" -o nuts-linux-${{ matrix.arch }} - name: Upload binary env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index e8ed4951a..ddc839121 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -29,6 +29,12 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: persist-credentials: false + # go build stamps the module version from git. A tag build only needs + # the tagged commit. An untagged branch push (the :master image) needs + # the history back to the nearest tag, otherwise the stamp becomes + # v6.0.0-