fix: update Go to 1.25 for compatibility with oauth2 dependency #4
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*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| create-release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: false | |
| generate_release_notes: true | |
| build: | |
| name: Build ${{ matrix.platform }} | |
| runs-on: ${{ matrix.os }} | |
| needs: create-release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform: linux-amd64 | |
| goos: linux | |
| goarch: amd64 | |
| - os: ubuntu-latest | |
| platform: linux-arm64 | |
| goos: linux | |
| goarch: arm64 | |
| - os: ubuntu-latest | |
| platform: windows-amd64 | |
| goos: windows | |
| goarch: amd64 | |
| - os: macos-latest | |
| platform: darwin-amd64 | |
| goos: darwin | |
| goarch: amd64 | |
| - os: macos-latest | |
| platform: darwin-arm64 | |
| goos: darwin | |
| goarch: arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.23" | |
| check-latest: true | |
| - name: Test | |
| if: matrix.os == 'ubuntu-latest' && matrix.goos == 'linux' && matrix.goarch == 'amd64' | |
| run: go test ./... | |
| - name: Build binary | |
| shell: bash | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: 0 | |
| run: | | |
| mkdir -p dist | |
| BUILD_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ') | |
| BINARY="pindou" | |
| if [ "${{ matrix.goos }}" = "windows" ]; then | |
| BINARY="pindou.exe" | |
| fi | |
| go build -trimpath \ | |
| -ldflags="-s -w \ | |
| -X 'pindou/internal/version.Version=${{ github.ref_name }}' \ | |
| -X 'pindou/internal/version.BuildTime=${BUILD_TIME}' \ | |
| -X 'pindou/internal/version.GitCommit=${{ github.sha }}'" \ | |
| -o "dist/${BINARY}" ./cmd/server | |
| - name: Archive | |
| shell: bash | |
| run: | | |
| cd dist | |
| BINARY="pindou" | |
| if [ "${{ matrix.goos }}" = "windows" ]; then | |
| BINARY="pindou.exe" | |
| zip "pindou-${{ matrix.platform }}.zip" "${BINARY}" | |
| else | |
| tar czf "pindou-${{ matrix.platform }}.tar.gz" "${BINARY}" | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pindou-${{ matrix.platform }} | |
| path: dist/pindou-${{ matrix.platform }}.* | |
| retention-days: 7 | |
| - name: Upload to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/pindou-${{ matrix.platform }}.* |