Use example.com throughout, not lab.example.com #1
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
| # One branch, one source. A tag produces the binaries and the image together, | |
| # so "the Docker version" and "the binary version" cannot drift apart. | |
| name: release | |
| on: | |
| push: | |
| tags: ['v*'] | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| binaries: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: stable | |
| - name: Build | |
| run: | | |
| mkdir -p dist | |
| for target in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64; do | |
| os=${target%/*}; arch=${target#*/} | |
| CGO_ENABLED=0 GOOS=$os GOARCH=$arch \ | |
| go build -trimpath -ldflags '-s -w' \ | |
| -o dist/exploit-server-$os-$arch ./cmd/exploit-server | |
| done | |
| cd dist && sha256sum * > SHA256SUMS | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| generate_release_notes: true | |
| image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
| ghcr.io/${{ github.repository }}:latest |