Skip to content

Commit

Permalink
Remove GIT_TAG from goreleaser workflow
Browse files Browse the repository at this point in the history
Co-authored-by: Gert Jan Kamstra <gert.jan.kamstra@philips.com>
  • Loading branch information
marcofranssen and gjkamstra committed Aug 26, 2021
1 parent 874fa56 commit c44200d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,31 @@ jobs:
if [[ -n "$LDFLAGS" ]]; then
echo "::set-output name=LDFLAGS::$LDFLAGS"
fi
if [[ -n "$GIT_TAG" ]]; then
echo "::set-output name=GIT_TAG::$GIT_TAG"
fi
if [[ -n "$GIT_HASH" ]]; then
echo "::set-output name=GIT_HASH::$GIT_HASH"
fi
rm -f /tmp/spiffe-vault-release-vars.env
- name: Release
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
LDFLAGS: ${{ steps.release-vars.outputs.LDFLAGS }}
GIT_TAG: ${{ steps.release-vars.outputs.GIT_TAG }}
GIT_HASH: ${{ steps.release-vars.outputs.GIT_HASH }}

- name: Release snapshot
uses: goreleaser/goreleaser-action@v2
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
with:
version: latest
args: release --rm-dist --snapshot
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
LDFLAGS: ${{ steps.release-vars.outputs.LDFLAGS }}
GIT_HASH: ${{ steps.release-vars.outputs.GIT_HASH }}

- name: Logout from DockerHub Registry
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ dockers:
- goos: linux
goarch: amd64
image_templates:
- "philipssoftware/{{ .ProjectName }}:{{ .Tag }}"
- "philipssoftware/{{ .ProjectName }}:{{ .Env.GIT_HASH }}"
- "philipssoftware/{{ .ProjectName }}:{{ .Env.GIT_TAG }}"
build_flag_templates:
- "--pull"
- "--label=com.opencontainers.image.created={{.Date}}"
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ release: ## creates a release using goreleaser

release-vars: ## print the release variables for goreleaser
@echo export LDFLAGS=\"$(LDFLAGS)\"
@echo export GIT_TAG=$(GIT_TAG)
@echo export GIT_HASH=$(GIT_HASH)

0 comments on commit c44200d

Please sign in to comment.