name: Build on: push: branches: [master] tags: [v*] permissions: contents: write jobs: goreleaser: name: Goreleaser runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Login to DockerHub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up Go uses: actions/setup-go@v5 with: go-version: "1.24" cache-dependency-path: | go.sum - name: Remove unsupported tags run: git tag -d $(git tag -l "pb/*") - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 if: ${{ contains(github.ref, 'v') }} with: # either 'goreleaser' (default) or 'goreleaser-pro' distribution: goreleaser version: latest args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Test GoReleaser uses: goreleaser/goreleaser-action@v6 if: ${{ ! contains(github.ref, 'v') }} with: # either 'goreleaser' (default) or 'goreleaser-pro' distribution: goreleaser version: latest args: release --snapshot --clean - name: Upload assets uses: actions/upload-artifact@v4 with: name: go-judge path: dist/ upload-artifacts: name: Upload artifacts-${{ matrix.os }}-${{ matrix.arch }} runs-on: ubuntu-latest needs: goreleaser strategy: matrix: os: - windows - linux - darwin arch: - amd64_v3 - arm64_v8.0 steps: - uses: actions/download-artifact@v4 with: name: go-judge path: dist - name: Upload assets go-judge uses: actions/upload-artifact@v4 with: name: go-judge_${{ matrix.os == 'darwin' && 'macos' || matrix.os }}_${{ matrix.arch }} path: dist/go-judge_${{ matrix.os }}_${{ matrix.arch }}/go-judge${{ matrix.os == 'windows' && '.exe' || ''}} - name: Upload assets go-judge-shell uses: actions/upload-artifact@v4 with: name: go-judge-shell_${{ matrix.os == 'darwin' && 'macos' || matrix.os }}_${{ matrix.arch }} path: dist/go-judge-shell_${{ matrix.os }}_${{ matrix.arch }}/go-judge-shell${{ matrix.os == 'windows' && '.exe' || ''}}