name: test build on: push: env: GOPATH: ${{ github.workspace }} GOBIN: ${{ github.workspace }}/bin jobs: build-x86_64: name: Build wiki binary for x86_64 runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-22.04, macos-latest ] steps: - name: Checkout wiki code uses: actions/checkout@v3 with: path: go-sdk - name: Set up Go uses: actions/setup-go@v3 with: go-version-file: go-sdk/go.mod - name: Checkout dependence repo uses: actions/checkout@v3 with: repository: woop-chain/mcl path: ${{ github.workspace }}/src/github.com/woop-chain/mcl - name: Checkout dependence repo uses: actions/checkout@v3 with: repository: woop-chain/bls path: ${{ github.workspace }}/src/github.com/woop-chain/bls - name: Checkout dependence code uses: actions/checkout@v2 with: repository: woop-chain/woop path: ${{ github.workspace }}/src/github.com/woop-chain/woop ref: main fetch-depth: 0 - name: Get latest version and release run: | VERSION=$(git tag -l --sort=-v:refname | head -n 1 | tr -d v) RELEASE=$(git describe --long | cut -f2 -d-) echo "build_version=$VERSION" >> $GITHUB_ENV echo "build_release=$RELEASE" >> $GITHUB_ENV working-directory: go-sdk - name: Debug run: | pwd echo ${HOME} echo ${GITHUB_WORKSPACE} echo ${GOPATH} echo ${GOROOT} ls ${{ github.workspace }}/src/github.com/woop-chain/ - name: Build wiki binary for linux ubuntu if: matrix.os == 'ubuntu-22.04' run: | make static working-directory: go-sdk - name: Build libs for macos-latest if: matrix.os == 'macos-latest' run: | brew install gmp brew install openssl sudo mkdir -p /opt/homebrew/opt/ sudo ln -sf /usr/local/opt/openssl@1.1 /opt/homebrew/opt/openssl@1.1 echo "ls -l /opt/homebrew/opt/openssl@1.1"; ls -l /opt/homebrew/opt/openssl@1.1 make libs working-directory: ${{ github.workspace }}/src/github.com/woop-chain/woop - name: Build wiki binary for macos-latest x86_64 if: matrix.os == 'macos-latest' run: | make all working-directory: go-sdk - name: Upload artifact for linux uses: actions/upload-artifact@v3 if: matrix.os == 'ubuntu-22.04' with: name: wiki-linux path: ${{ github.workspace }}/go-sdk/dist/* retention-days: 1 - name: Upload artifact for darwin uses: actions/upload-artifact@v3 if: matrix.os == 'macos-latest' with: name: wiki-darwin path: ${{ github.workspace }}/go-sdk/dist/* retention-days: 1