|
|
|
@ -31,11 +31,21 @@ jobs:
|
|
|
|
|
with:
|
|
|
|
|
go-version-file: ./go.mod
|
|
|
|
|
|
|
|
|
|
- name: Determine OS Name
|
|
|
|
|
id: os-name
|
|
|
|
|
run: |
|
|
|
|
|
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
|
|
|
|
|
echo "OS=linux" >> $GITHUB_ENV
|
|
|
|
|
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
|
|
|
|
|
echo "OS=darwin" >> $GITHUB_ENV
|
|
|
|
|
else
|
|
|
|
|
echo "OS=windows" >> $GITHUB_ENV
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
- name: Build binary on Linux and macOS
|
|
|
|
|
if: matrix.os != 'windows-latest'
|
|
|
|
|
env:
|
|
|
|
|
OS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}
|
|
|
|
|
GOOS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}
|
|
|
|
|
GOOS: ${{ env.OS }}
|
|
|
|
|
GOARCH: ${{ matrix.arch }}
|
|
|
|
|
run: |
|
|
|
|
|
go build -o fabric-${OS}-${{ matrix.arch }}-${{ github.ref_name }} .
|
|
|
|
@ -43,7 +53,6 @@ jobs:
|
|
|
|
|
- name: Build binary on Windows
|
|
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
|
env:
|
|
|
|
|
OS: windows
|
|
|
|
|
GOOS: windows
|
|
|
|
|
GOARCH: ${{ matrix.arch }}
|
|
|
|
|
run: |
|
|
|
|
@ -58,4 +67,4 @@ jobs:
|
|
|
|
|
- name: Upload release artifact
|
|
|
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
|
|
|
run: |
|
|
|
|
|
gh release upload ${{ github.ref_name }} fabric-*-${{ matrix.arch }}-${{ github.ref_name }}*
|
|
|
|
|
gh release upload ${{ github.ref_name }} fabric-${{ env.OS }}-${{ matrix.arch }}-${{ github.ref_name }}
|
|
|
|
|