Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
GOOS: linux
GOARCH: amd64
run: |
go build -ldflags "-s -w -X github.com/checkmarx/2ms/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms main.go
go build -ldflags "-s -w -X github.com/checkmarx/2ms/v5/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms main.go
zip -j dist/linux-amd64.zip dist/2ms
rm dist/2ms
- name: Compile for Linux arm64
Expand All @@ -81,7 +81,7 @@ jobs:
GOOS: linux
GOARCH: arm64
run: |
go build -ldflags "-s -w -X github.com/checkmarx/2ms/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms main.go
go build -ldflags "-s -w -X github.com/checkmarx/2ms/v5/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms main.go
zip -j dist/linux-arm64.zip dist/2ms
rm dist/2ms

Expand All @@ -92,7 +92,7 @@ jobs:
GOOS: darwin
GOARCH: amd64
run: |
go build -ldflags "-s -w -X github.com/checkmarx/2ms/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms main.go
go build -ldflags "-s -w -X github.com/checkmarx/2ms/v5/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms main.go
zip -j dist/macos-amd64.zip dist/2ms
rm dist/2ms

Expand All @@ -103,7 +103,7 @@ jobs:
GOOS: darwin
GOARCH: arm64
run: |
go build -ldflags "-s -w -X github.com/checkmarx/2ms/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms main.go
go build -ldflags "-s -w -X github.com/checkmarx/2ms/v5/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms main.go
zip -j dist/macos-arm64.zip dist/2ms
rm dist/2ms

Expand All @@ -114,7 +114,7 @@ jobs:
GOOS: windows
GOARCH: amd64
run: |
go build -ldflags "-s -w -X github.com/checkmarx/2ms/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms.exe main.go
go build -ldflags "-s -w -X github.com/checkmarx/2ms/v5/cmd.Version=$VERSION" -a -installsuffix cgo -o dist/2ms.exe main.go
zip -j dist/windows-amd64.zip dist/2ms.exe
rm dist/2ms.exe

Expand All @@ -139,7 +139,7 @@ jobs:
tag_name: ${{ needs.test.outputs.git_tag }}
name: ${{ needs.test.outputs.git_tag }}
body: ${{ needs.test.outputs.notes }}
target_commitish: ${{ steps.commit_and_push.outputs.latest_commit_hash }}
target_commitish: ${{ github.sha }}
files: |
dist/*.zip

Expand All @@ -152,6 +152,8 @@ jobs:
tags: |
checkmarx/2ms:latest
checkmarx/2ms:${{ needs.test.outputs.version }}
build-args: |
VERSION=${{ needs.test.outputs.version }}

- name: Update Docker repo description
uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae # v4.0.0
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ FROM checkmarx/go:1.26.2-r0-9bc691851ef224@sha256:9bc691851ef2244d13b0b9ff48bd2d

WORKDIR /app

ARG VERSION=0.0.0

#Copy go mod and sum files
COPY go.mod .
COPY go.sum .
Expand All @@ -17,7 +19,7 @@ RUN go mod download
# COPY the source code as the last step
COPY . .

RUN GOOS=linux GOARCH=amd64 go build -buildvcs=false -ldflags="-s -w" -a -o /app/2ms .
RUN GOOS=linux GOARCH=amd64 go build -buildvcs=false -ldflags="-s -w -X github.com/checkmarx/2ms/v5/cmd.Version=${VERSION}" -a -o /app/2ms .

# Runtime image
FROM checkmarx/git:2.54.0-r0-586cb59ae2f323@sha256:586cb59ae2f323b619760be099e9029828954aa6d5a230f0b0dc37a623894d6f
Expand All @@ -32,4 +34,4 @@ COPY --from=builder /app/2ms /app/2ms

RUN git config --global --add safe.directory /repo

ENTRYPOINT [ "/app/2ms" ]
ENTRYPOINT [ "/app/2ms" ]
Loading