Skip to content

Commit

Permalink
Update reuse-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Go0p authored May 22, 2024
1 parent 47b483e commit 57a49a7
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/reuse-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,17 @@ jobs:
go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(git show -s --format=%cd)' -X 'main.yakVersion=${{ env.YAK_TAG }}'" -o ./yak_windows_amd64.exe -v common/yak/cmd/yak.go
if: runner.os == 'Windows'

- name: Install Go 1.20.3 in Docker container
if: inputs.os == 'centos7-amd64'
run: |
docker run --rm centos:7 /bin/bash -c "
yum install -y gcc make && \
yum install -y https://dl.google.com/go/go1.20.3.linux-amd64.tar.gz && \
export PATH=$PATH:/usr/local/go/bin
"
- name: Build For CentOS 7
if: inputs.os == 'centos7-amd64'
run: |
docker run --rm -v $PWD:/workspace -w /workspace centos:7 /bin/bash -c "
docker run --rm -v $PWD:/workspace -w /workspace \
-e YAK_TAG=$YAK_TAG \
centos:7 /bin/bash -c "
yum install -y gcc make && \
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags '-linkmode external -extldflags -static -s -w -X main.goVersion=$(go version) -X main.gitHash=$(git show -s --format=%H) -X main.buildTime=$(git show -s --format=%cd) -X main.yakVersion=${{ env.YAK_TAG }}' -o ./yak_centos7_amd64 common/yak/cmd/yak.go && ls
curl -LO https://golang.org/dl/go1.20.3.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.20.3.linux-amd64.tar.gz && \
export PATH=$PATH:/usr/local/go/bin && \
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags '-linkmode external -extldflags -static -s -w -X main.goVersion=$(go version) -X main.gitHash=12345678 -X main.buildTime=12345678 -X main.yakVersion=$YAK_TAG' -o ./yak_centos7_amd64 common/yak/cmd/yak.go && ls
"
- name: Upload Artifacts Windows
Expand Down

0 comments on commit 57a49a7

Please sign in to comment.