documentation updates #17
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: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| name: Build Linux binaries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: src/go.mod | |
| - name: Build linux/amd64 | |
| run: | | |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ | |
| go build -C src -ldflags="-s -w" -o ../bin/srvguard-linux-amd64 . | |
| - name: Build linux/arm64 | |
| run: | | |
| CGO_ENABLED=0 GOOS=linux GOARCH=arm64 \ | |
| go build -C src -ldflags="-s -w" -o ../bin/srvguard-linux-arm64 . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: srvguard-binaries | |
| path: bin/srvguard-linux-* | |
| retention-days: 30 | |
| release: | |
| name: Create release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: srvguard-binaries | |
| path: bin/ | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: bin/srvguard-linux-* | |
| generate_release_notes: true |