chore: bump version to 0.3.0 #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*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| verify-version: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check source version matches tag | |
| run: | | |
| TAG="${GITHUB_REF_NAME#v}" | |
| SOURCE=$(grep 'const Version' version.go | cut -d'"' -f2) | |
| if [ "$TAG" != "$SOURCE" ]; then | |
| echo "::error::Tag v$TAG does not match source version $SOURCE — bump version.go first" | |
| exit 1 | |
| fi | |
| test: | |
| needs: verify-version | |
| name: Test (Go ${{ matrix.go-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-version: ["1.25", "1.26"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: false | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.10 | |
| - name: Test | |
| run: go test -race -coverprofile=coverage.out -coverpkg=github.com/rdapapi/rdapapi-go ./... | |
| - name: Check coverage | |
| run: | | |
| COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | tr -d '%') | |
| echo "Coverage: ${COVERAGE}%" | |
| if [ "$(echo "$COVERAGE < 100" | bc)" -eq 1 ]; then | |
| echo "::error::Coverage is ${COVERAGE}%, expected 100%" | |
| exit 1 | |
| fi | |
| - name: Build | |
| run: go build ./... | |
| release: | |
| name: Release | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Refresh pkg.go.dev | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} | |
| curl -s "https://pkg.go.dev/fetch/github.com/rdapapi/rdapapi-go@${TAG}" || true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true |