Adapt cdn protocol 401 & 410 codes #2
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.goos }}/${{ matrix.goarch }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: linux | |
| goarch: amd64 | |
| runner: ubuntu-latest | |
| artifact: http2tor-linux-amd64 | |
| binary: http2tor | |
| static: true | |
| - goos: linux | |
| goarch: arm64 | |
| runner: ubuntu-latest | |
| artifact: http2tor-linux-arm64 | |
| binary: http2tor | |
| static: true | |
| - goos: windows | |
| goarch: amd64 | |
| runner: ubuntu-latest | |
| artifact: http2tor-windows-amd64 | |
| binary: http2tor.exe | |
| static: true | |
| - goos: darwin | |
| goarch: amd64 | |
| runner: macos-latest | |
| artifact: http2tor-darwin-amd64 | |
| binary: http2tor | |
| static: false | |
| - goos: darwin | |
| goarch: arm64 | |
| runner: macos-latest | |
| artifact: http2tor-darwin-arm64 | |
| binary: http2tor | |
| static: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Verify dependencies | |
| run: go mod verify | |
| - name: Build (static) | |
| if: matrix.static == true | |
| env: | |
| CGO_ENABLED: "0" | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: | | |
| go build \ | |
| -trimpath \ | |
| -ldflags="-extldflags -static -s -w -X main.version=${{ github.ref_name }}" \ | |
| -tags netgo \ | |
| -o out/${{ matrix.binary }} \ | |
| ./cmd/http2tor | |
| - name: Build (dynamic) | |
| if: matrix.static == false | |
| env: | |
| CGO_ENABLED: "0" | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: | | |
| go build \ | |
| -trimpath \ | |
| -ldflags="-s -w -X main.version=${{ github.ref_name }}" \ | |
| -tags netgo \ | |
| -o out/${{ matrix.binary }} \ | |
| ./cmd/http2tor | |
| - name: Archive binary | |
| run: | | |
| cd out | |
| tar -czf ${{ matrix.artifact }}.tar.gz ${{ matrix.binary }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: out/${{ matrix.artifact }}.tar.gz | |
| retention-days: 1 | |
| release: | |
| name: Publish release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/*.tar.gz | |
| generate_release_notes: true |