Skip to content

Commit

Permalink
fix: correct go build error passing (#1067)
Browse files Browse the repository at this point in the history
Closes #673
  • Loading branch information
lidel authored Feb 1, 2024
1 parent 82d3e0f commit da84766
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ on:

env:
DIST_ROOT: ${{ github.event.inputs.custom_dist_root || '/ipns/dist.ipfs.tech' }} # content root used for calculating diff to build
KUBO_VER: 'v0.24.0' # kubo daemon used for chunking and applying diff
CLUSTER_CTL_VER: 'v1.0.7' # ipfs-cluster-ctl used for pinning
KUBO_VER: 'v0.26.0' # kubo daemon used for chunking and applying diff
CLUSTER_CTL_VER: 'v1.0.8' # ipfs-cluster-ctl used for pinning

jobs:
build:
runs-on: ${{ fromJSON(vars.CI_BUILD_RUNS_ON || '"ubuntu-latest"') }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
- env:
Expand All @@ -46,8 +46,8 @@ jobs:
lint:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
- run: npm ci --no-audit --progress=false
Expand All @@ -57,7 +57,7 @@ jobs:
runs-on: "macos-latest"
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Retrieve unsigned artifacts
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -100,10 +100,10 @@ jobs:
environment: Deploy
steps:
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Retrieve signed artifacts
uses: actions/download-artifact@v3
continue-on-error: true # skip if no releases
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
prepare-matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: awk 'NR == FNR {f1[$0] = 1; next}; !($0 in f1)' ignored-during-nightly <(ls ./dists -1) > nightlies-to-run
- id: set-matrix
run: echo "::set-output name=matrix::$(jq -nc '$ARGS.positional' --args $(cat nightlies-to-run))"
Expand All @@ -38,7 +38,7 @@ jobs:
matrix:
dist_name: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- env:
CLUSTER_USER: ${{ secrets.CLUSTER_USER }}
CLUSTER_PASSWORD: ${{ secrets.CLUSTER_PASSWORD }}
Expand Down
9 changes: 5 additions & 4 deletions build-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ function goBuild() {

local output
output="$(pwd)/$(basename "$package")$(go env GOEXE)"
go build -mod=mod -o "$output" \
-trimpath \
"${package}"
if ! (go build -mod=mod -o "$output" -trimpath "${package}"); then
warn " go build of $output failed."
return 1
fi

if [ -x "$(which glibc-check)" ] && [ "$GOOS" == "linux" ] && [ "$GOARCH" == "amd64" ]; then
echo "GLIBC versions:"
Expand Down Expand Up @@ -144,7 +145,7 @@ function doBuild() {

mkdir -p "$dir"

if ! (cd "$build_dir_name" && goBuild "$package" "$goos" "$goarch") > build-log; then
if ! (cd "$build_dir_name" && goBuild "$package" "$goos" "$goarch") > "$build_dir_name/build-log" 2>&1; then
local logfi="$dir/build-log-$goos-$goarch"
cp "$build_dir_name/build-log" "$logfi"
warn " $binname failed. logfile at '$logfi'"
Expand Down

0 comments on commit da84766

Please sign in to comment.