Skip to content

Commit e24f5cb

Browse files
authored
Changing build release to ref_name and moving logging (#6)
* using github.ref_name as build release info * moving build logging info right before start
1 parent 3573d53 commit e24f5cb

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ jobs:
6666
cache-to: type=local,dest=/tmp/.buildx-cache
6767
build-args: |
6868
TibiadataBuildBuilder=github
69-
TibiadataBuildRelease=${{ github.event.release.tag_name }}
69+
TibiadataBuildRelease=${{ github.ref_name }}
7070
TibiadataBuildCommit=${{ github.sha }}

src/webserver.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,8 @@ type Information struct {
4141
}
4242

4343
func main() {
44-
// logging things on start of TibiaData
44+
// logging start of TibiaData
4545
log.Printf("[info] TibiaData API starting..")
46-
log.Printf("[info] TibiaData API release: %s", TibiadataBuildRelease)
47-
log.Printf("[info] TibiaData API build: %s", TibiadataBuildBuilder)
48-
log.Printf("[info] TibiaData API commit: %s", TibiadataBuildCommit)
49-
log.Printf("[info] TibiaData API edition: %s", TibiadataBuildEdition)
5046

5147
// setting application to ReleaseMode if DEBUG_MODE is false
5248
if !getEnvAsBool("DEBUG_MODE", false) {
@@ -128,6 +124,12 @@ func main() {
128124
})
129125
})
130126

127+
// logging build information
128+
log.Printf("[info] TibiaData API release: %s", TibiadataBuildRelease)
129+
log.Printf("[info] TibiaData API build: %s", TibiadataBuildBuilder)
130+
log.Printf("[info] TibiaData API commit: %s", TibiadataBuildCommit)
131+
log.Printf("[info] TibiaData API edition: %s", TibiadataBuildEdition)
132+
131133
// Start the router
132134
router.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
133135
}

0 commit comments

Comments
 (0)