Skip to content

Commit

Permalink
feat: get version based on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mul14 committed Apr 19, 2024
1 parent 83b97fe commit b35c939
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
VERSION=$GITHUB_REF_NAME||$GITHUB_HEAD_REF
echo "Raiden version: $VERSION"
sed "s@.*appVersion = \".*\"$@\tappVersion = \"$VERSION\"@" 'cmd/raiden/commands/version.go'
go build -ldflags="-s -w" -trimpath -o build/raiden ./cmd/raiden/main.go
cd build
if [[ $GOOS == 'darwin' ]]; then
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build-linux:
GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/$(CLI_BINARY_NAME)_linux_$(CLI_VERSION) ./cmd/raiden/main.go

build-linux-arm64:
GOOS=linux GOARCH=arm64 go build -o $(BUILD_DIR)/$(CLI_BINARY_NAME)_linux_arm64_$(CLI_VERSION) ./cmd/cli/raiden.go
GOOS=linux GOARCH=arm64 go build -o $(BUILD_DIR)/$(CLI_BINARY_NAME)_linux_arm64_$(CLI_VERSION) ./cmd/raiden/main.go

build-windows:
GOOS=windows GOARCH=amd64 go build -o $(BUILD_DIR)/$(CLI_BINARY_NAME)_windows_$(CLI_VERSION).exe ./cmd/raiden/main.go
Expand All @@ -22,7 +22,7 @@ build-macos:
GOOS=darwin GOARCH=amd64 go build -o $(BUILD_DIR)/$(CLI_BINARY_NAME)_macos_$(CLI_VERSION) ./cmd/raiden/main.go

build-macos-arm64:
GOOS=darwin GOARCH=arm64 go build -o $(BUILD_DIR)/$(CLI_BINARY_NAME)_macos_arm64_$(CLI_VERSION) ./cmd/cli/raiden.go
GOOS=darwin GOARCH=arm64 go build -o $(BUILD_DIR)/$(CLI_BINARY_NAME)_macos_arm64_$(CLI_VERSION) ./cmd/raiden/main.go

clean:
go clean
Expand Down

0 comments on commit b35c939

Please sign in to comment.