Skip to content

Commit

Permalink
fix:[close #25] Automate Versioning
Browse files Browse the repository at this point in the history
- Go build defaults to `development`
- Tag releases override to use the `github.ref_name` (tag name).
- Continuous releases override to use commit sha
- Remove `VERSION` file
  • Loading branch information
jardon authored and kbdharun committed Jul 22, 2024
1 parent 06dbddf commit 27d1cd8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
apt-get install -y libbtrfs-dev libdevmapper-dev libgpgme-dev pkg-config build-essential libdpkg-dev
- name: Build
run: go build -o abrootv2
run: go build -o abrootv2 -ldflags="-X 'main.Version=${{ github.sha }}'"

- name: Test
run: go test -v ./tests/...
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
apt-get install -y libbtrfs-dev libdevmapper-dev libgpgme-dev pkg-config build-essential
- name: Build
run: go build -o abrootv2
run: go build -o abrootv2 -ldflags="-X 'main.Version=${{ github.ref_name }}'"

- name: Compress
run: tar -czvf abrootv2.tar.gz abrootv2
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/vanilla-os/orchid/cmdr"
)

var Version = "2.0.1"
var Version = "development"

//go:embed locales/*.yml
var fs embed.FS
Expand Down

0 comments on commit 27d1cd8

Please sign in to comment.