File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 name : built-binaries
3131 path : bin/*
3232
33+ check :
34+ outputs :
35+ should_skip : ${{ steps.decide.outputs.skip }}
36+ steps :
37+ - name : Extract version from main.go
38+ id : version
39+ run : |
40+ VER=$(sed -n 's/^const VERSION = "\(v[0-9]*\.[0-9]*\.[0-9]*\)".*$/\1/p' ./cmd/main.go)
41+ echo "ver=$VER" >> $GITHUB_OUTPUT
42+
43+ - name : Skip if version unchanged
44+ run : |
45+ if [ "${{ steps.version.outputs.ver }}" = "${{ steps.latest.outputs.latest }}" ]; then
46+ echo "Version already released: ${{ steps.version.outputs.ver }}"
47+ echo "skip=true" >> $GITHUB_OUTPUT
48+ fi
3349
3450 release :
35- needs : build
51+ needs : build, check
52+ if : needs.check.outputs.should_skip != 'true'
3653 runs-on : ubuntu-latest
3754
3855 steps :
4966
5067 echo "latest=$LATEST" >> $GITHUB_OUTPUT
5168
52- - name : Extract version from main.go
53- id : version
54- run : |
55- VER=$(sed -n 's/^const VERSION = "\(v[0-9]*\.[0-9]*\.[0-9]*\)".*$/\1/p' ./cmd/main.go)
56- echo "ver=$VER" >> $GITHUB_OUTPUT
57-
58- - name : Skip if version unchanged
59- run : |
60- if [ "${{ steps.version.outputs.ver }}" = "${{ steps.latest.outputs.latest }}" ]; then
61- echo "Version already released: ${{ steps.version.outputs.ver }}"
62- exit 1
63- fi
64-
6569 - name : Extract commit message
6670 id : commit_msg
6771 run : |
Original file line number Diff line number Diff line change 11GOC := go
22
3+ # NOTE: By default any and all builds will be a debug build by default, only once a stable release has been made this will change.
34GOFLAGS_PROD := -ldflags "-s -w -X main.IS_PROD=TRUE -X main.PORT=:8000" -trimpath -buildvcs=false
4- GOFLAGS_DEV := -ldflags "-s -w - X main.IS_PROD=FALSE -X main.PORT=:8000" -trimpath -buildvcs=false
5+ GOFLAGS_DEV := -ldflags "-X main.IS_PROD=FALSE -X main.PORT=:8000" -trimpath -buildvcs=false
56
67.PHONY : run build release
78
@@ -46,5 +47,5 @@ $(PLATFORMS):
4647 mkdir -p $(BUILD )
4748 GOOS=$(word 1,$(subst -, ,$@ ) ) \
4849 GOARCH=$(word 2,$(subst -, ,$@ ) ) \
49- $(GOC ) build $(GOFLAGS_PROD ) \
50+ $(GOC ) build $(GOFLAGS_DEV ) \
5051 -o $(BUILD ) /$(APP_NAME ) -$@ $(ENTRY )
You can’t perform that action at this time.
0 commit comments