Skip to content

Commit

Permalink
set version in github release and print it
Browse files Browse the repository at this point in the history
Signed-off-by: Malte Muench <[email protected]>
  • Loading branch information
Malte Muench committed May 10, 2024
1 parent fdff89c commit b6c9fb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ jobs:
binary_name: can2mqtt
compress_assets: false
project_path: src
ldflags: -X "main.version=${{ vars.GITHUB_REF_NAME }}"
env:
CGO_ENABLED: 0
17 changes: 10 additions & 7 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ import (
"sync"
)

var pairFromID map[uint32]*can2mqtt // c2m pair (lookup from ID)
var pairFromTopic map[string]*can2mqtt // c2m pair (lookup from Topic)
var debugLog bool
var canInterface, mqttConnection, configFile string
var dirMode = 0 // directional modes: 0=bidirectional 1=can2mqtt only 2=mqtt2can only [-d]
var wg sync.WaitGroup
var (
pairFromID map[uint32]*can2mqtt // c2m pair (lookup from ID)
pairFromTopic map[string]*can2mqtt // c2m pair (lookup from Topic)
debugLog bool
canInterface, mqttConnection, configFile string
version = "dev"
dirMode = 0 // directional modes: 0=bidirectional 1=can2mqtt only 2=mqtt2can only [-d]
wg sync.WaitGroup
)

func main() {
log.SetFlags(0)
Expand All @@ -38,7 +41,7 @@ func main() {
slog.SetLogLoggerLevel(slog.LevelDebug)
}

slog.Info("Starting can2mqtt", "mqtt-config", mqttConnection, "can-interface", canInterface, "can2mqtt.csv", configFile, "dir-mode", dirMode, "debug", debugLog)
slog.Info("Starting can2mqtt", "version", version, "mqtt-config", mqttConnection, "can-interface", canInterface, "can2mqtt.csv", configFile, "dir-mode", dirMode, "debug", debugLog)
wg.Add(1)
go canStart(canInterface) // epic parallel shit ;-)
mqttStart(mqttConnection)
Expand Down

0 comments on commit b6c9fb2

Please sign in to comment.