Skip to content

Commit 3d84d5b

Browse files
committed
Adjust version go file
1 parent 917ada4 commit 3d84d5b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/publish-go.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ jobs:
4545
run: $HOME/protoc/bin/protoc --proto_path=. --go_out=./api --go_opt=paths=source_relative org/polypheny/prism/*.proto
4646

4747
- name: Create Version Go file
48-
run: echo -e "package api\n\n// Version - API version\nconst Version = \"${{ env.VERSION }}\"" > ./api/version.go
48+
run: |
49+
# Assuming VERSION is in the format 'major.minor'
50+
IFS='.' read -r MAJOR MINOR <<< "${{ env.VERSION }}"
51+
# Create a Go file with major and minor constants
52+
echo -e "package api\n\n// MajorVersion - Major component of the API version\nconst MajorVersion = $MAJOR\n\n// MinorVersion - Minor component of the API version\nconst MinorVersion = $MINOR" > ./api/version.go
4953
5054
- name: Package Generated Files
5155
run: tar -czvf go-api-files-${{ env.VERSION }}.tar.gz ./api

0 commit comments

Comments
 (0)