| name: Go Build |
|
|
| on: |
| release: |
| types: |
| - created |
| workflow_dispatch: |
|
|
| jobs: |
| build: |
| name: Build |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| include: |
| - goos: windows |
| goarch: 386 |
| - goos: windows |
| goarch: amd64 |
| - goos: windows |
| goarch: arm64 |
| - goos: linux |
| goarch: 386 |
| - goos: linux |
| goarch: amd64 |
| - goos: linux |
| goarch: arm64 |
| - goos: freebsd |
| goarch: 386 |
| - goos: freebsd |
| goarch: amd64 |
| - goos: freebsd |
| goarch: arm64 |
| steps: |
| - name: Checkout code |
| uses: actions/checkout@v3 |
|
|
| - name: Setup Go |
| uses: actions/setup-go@v4 |
| with: |
| go-version: '1.22' |
|
|
| - name: Build |
| run: | |
| echo "Building for ${{ matrix.goos }} ${{ matrix.goarch }}" |
| suffix="" |
| if [ "${{ matrix.goos }}" == "windows" ]; then |
| suffix=".exe" |
| fi |
| GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ./build/ddgchatgo-${{ matrix.goos }}-${{ matrix.goarch }}$suffix |
| |
| - name: Upload release artifact |
| uses: svenstaro/upload-release-action@v2 |
| with: |
| repo_token: ${{ secrets.GITHUB_TOKEN }} |
| file: ./build/ddgchatgo-${{ matrix.goos }}-${{ matrix.goarch }}* |
| file_glob: true |
| tag: ${{ github.ref_name }} |
| name: ddgchatgo-${{ matrix.goos }}-${{ matrix.goarch }} |
|
|