enrich json, show refresh interval and bits indicator, extend samplin… #11
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: | |
| branches: | |
| - main | |
| paths: | |
| - VERSION | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Read VERSION | |
| id: version | |
| run: | | |
| VERSION=$(cat VERSION | tr -d '[:space:]') | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT" | |
| - name: Validate semver | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| if ! echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9._-]+)?(\+[a-zA-Z0-9._-]+)?$'; then | |
| echo "ERROR: VERSION '${VERSION}' is not valid semver (expected e.g. 1.2.3)" | |
| exit 1 | |
| fi | |
| echo "Version ${VERSION} is valid semver." | |
| - name: Check tag does not already exist | |
| run: | | |
| TAG="${{ steps.version.outputs.tag }}" | |
| if git ls-remote --tags origin | grep -q "refs/tags/${TAG}$"; then | |
| echo "ERROR: Tag ${TAG} already exists. Bump VERSION before releasing." | |
| exit 1 | |
| fi | |
| echo "Tag ${TAG} is new — proceeding." | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Test | |
| run: go test ./... -race | |
| - name: Create and push git tag | |
| run: | | |
| TAG="${{ steps.version.outputs.tag }}" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag "$TAG" -m "Release $TAG" | |
| git push origin "$TAG" | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} |