Skip to content

Commit

Permalink
Use ldflags for version injection
Browse files Browse the repository at this point in the history
  • Loading branch information
qbart committed Nov 9, 2021
1 parent 2a52f03 commit 362296c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 28 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.17.1
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: Selleo/cli
-
name: Prepare verison for go embed
run: |
echo "${{ steps.meta.outputs.tags }}" > version.txt
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
builds:
-
ldflags:
- -s -w
- -s -w -X github.com/Selleo/cli/selleo.Version={{.Tag}}
goarch:
- amd64
- arm64
Expand Down
4 changes: 4 additions & 0 deletions selleo/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package selleo

// Version will be replaced by goreleaser using ldflags.
var Version string = "dev"
6 changes: 0 additions & 6 deletions selleo/version_dev.go

This file was deleted.

11 changes: 0 additions & 11 deletions selleo/version_prod.go

This file was deleted.

0 comments on commit 362296c

Please sign in to comment.