Skip to content

Commit 27d1cd8

Browse files
jardonkbdharun
authored andcommitted
fix:[close Vanilla-OS#25] Automate Versioning
- 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
1 parent 06dbddf commit 27d1cd8

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

.github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
apt-get install -y libbtrfs-dev libdevmapper-dev libgpgme-dev pkg-config build-essential libdpkg-dev
2828
2929
- name: Build
30-
run: go build -o abrootv2
30+
run: go build -o abrootv2 -ldflags="-X 'main.Version=${{ github.sha }}'"
3131

3232
- name: Test
3333
run: go test -v ./tests/...

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
apt-get install -y libbtrfs-dev libdevmapper-dev libgpgme-dev pkg-config build-essential
2525
2626
- name: Build
27-
run: go build -o abrootv2
27+
run: go build -o abrootv2 -ldflags="-X 'main.Version=${{ github.ref_name }}'"
2828

2929
- name: Compress
3030
run: tar -czvf abrootv2.tar.gz abrootv2

VERSION

-1
This file was deleted.

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/vanilla-os/orchid/cmdr"
2323
)
2424

25-
var Version = "2.0.1"
25+
var Version = "development"
2626

2727
//go:embed locales/*.yml
2828
var fs embed.FS

0 commit comments

Comments
 (0)