mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 13:11:49 +00:00
feat/ci: ship a static variant of sg linux/amd64 on (#61191)
feat/ci: ship a static variant of sg linux/amd64
This commit is contained in:
parent
532d79b296
commit
f7efbcb4c2
15
.github/workflows/sg-binary-release.yml
vendored
15
.github/workflows/sg-binary-release.yml
vendored
@ -115,6 +115,10 @@ jobs:
|
||||
GOARCH=${{ matrix.arch }} go build -o "sg_$(go env GOOS)_${{ matrix.arch }}" -trimpath -ldflags "-s -w -X main.BuildCommit=$(git rev-list -1 HEAD .)" .
|
||||
GOARCH=${{ matrix.arch }} go build -o "sg-msp_$(go env GOOS)_${{ matrix.arch }}" -tags=msp -trimpath -ldflags "-s -w -X main.BuildCommit=$(git rev-list -1 HEAD .)" .
|
||||
|
||||
# On certain CI agents, the glibc might not be the right one, so we build a static variant
|
||||
CGO_ENABLED=0 GOARCH=${{ matrix.arch }} go build -o "sg_$(go env GOOS)_${{ matrix.arch }}_static" -trimpath -ldflags "-s -w -X main.BuildCommit=$(git rev-list -1 HEAD .)" .
|
||||
CGO_ENABLED=0 GOARCH=${{ matrix.arch }} go build -o "sg-msp_$(go env GOOS)_${{ matrix.arch }}_static" -tags=msp -trimpath -ldflags "-s -w -X main.BuildCommit=$(git rev-list -1 HEAD .)" .
|
||||
|
||||
- name: Upload release asset
|
||||
run: |
|
||||
cd dev/sg
|
||||
@ -125,6 +129,17 @@ jobs:
|
||||
repo: sourcegraph/sg
|
||||
GITHUB_TOKEN: ${{ secrets.SG_RELEASE_TOKEN }}
|
||||
|
||||
- name: Upload release asset (linux-amd64-static)
|
||||
if: startswith(matrix.os, 'ubuntu-') == true
|
||||
run: |
|
||||
cd dev/sg
|
||||
release_name="${{ needs.create_release.outputs.release_name }}"
|
||||
gh release upload -R="${repo}" ${release_name} "sg_$(go env GOOS)_${{ matrix.arch }}_static"
|
||||
gh release upload -R="${repo}" ${release_name} "sg-msp_$(go env GOOS)_${{ matrix.arch }}_static"
|
||||
env:
|
||||
repo: sourcegraph/sg
|
||||
GITHUB_TOKEN: ${{ secrets.SG_RELEASE_TOKEN }}
|
||||
|
||||
report_failure:
|
||||
needs: build
|
||||
if: ${{ failure() }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user