Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 3

go get exits with status code 1 in Windows pwsh.

I decided to use “pwsh” for cross-compatibility when building on Linux and Windows. However, in Windows, go get does fail with status code 1. I guess it's associated with underlying git. Anybody has an idea?

 

screenshot-github.com-2019.11.23-11_54_53.png

 

workflow.yml:

name: CI/CD

on: [push]

jobs:
  build:
    name: BUILD / ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest]
        go: ['1.13']

    steps:
      - name: Pull the source code.
        uses: actions/checkout@v1

      - name: Prepare Go toolchain.
        uses: actions/setup-go@v1
        with:
          go-version: ${{ matrix.go }}

      - name: Install libasound2-dev on Linux.
        if: matrix.os == 'ubuntu-latest'
        run: |
          sudo apt-get update
          sudo apt-get install -y --no-install-recommends libasound2-dev

      - name: Build executable.
        shell: pwsh
        working-directory: cmd/macrosphere
        run: |
          # MACROSPHERE="macrosphere_`go env GOOS`_`go env GOARCH``go env GOEXE`"
          $MACROSPHERE="macrosphere_"+(go env GOOS)+"_"+(go env GOARCH)+(go env GOEXE)

          # ZIP_PASS=`uuidgen -r | tr -d '-'`
          $ZIP_PASS=(New-Guid).ToString() -replace '-', ''

          # Install statik executable.
          go get github.com/rakyll/statik

          # Embed assets with statik as a package.
          go generate -x

          # Build.
          go build -x -trimpath -ldflags="-w -s" -o="$MACROSPHERE"

          # Compress.
          7z a "$MACROSPHERE.zip" -p"$ZIP_PASS" "$MACROSPHERE"

          # Upload.
          curl -F file=@$MACROSPHERE.zip https://0x0.st

          # echo -e "\nZIP Password: $ZIP_PASS"
          echo "`nZIP Password: $ZIP_PASS"
2 Replies
GitHub Partner
Message 2 of 3

Re: go get exits with status code 1 in Windows pwsh.

Thanks for your feedback! I can repro this and has raised an internal ticket for tracking, will update once there is a response.

Copilot Lvl 2
Message 3 of 3

Re: go get exits with status code 1 in Windows pwsh.

if you confirmed go is returning exit code 1, then it sounds like an issue with go?