Merge pull request #2 from KatIsCoding/dev #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| arch: [amd64, arm64] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| cache: true | |
| - name: Build yatund | |
| run: | | |
| GOOS=linux GOARCH=${{ matrix.arch }} CGO_ENABLED=0 go build -o build/yatund-${{ matrix.arch }} ./cmd/yatund/ | |
| - name: Build yatun | |
| run: | | |
| GOOS=linux GOARCH=${{ matrix.arch }} CGO_ENABLED=0 go build -o build/yatun-${{ matrix.arch }} ./cmd/yatun/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries-${{ matrix.arch }} | |
| path: build/ | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Collect binaries | |
| run: | | |
| mkdir release | |
| find artifacts -type f -exec cp {} release/ \; | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| files: release/* | |
| generate_release_notes: true |