-
Notifications
You must be signed in to change notification settings - Fork 1
modanize releaser workflow #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # .github/workflows/tagpr.yaml | ||
| name: tagpr and release | ||
| on: | ||
| push: | ||
| branches: ["master"] | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "release tag" | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
| packages: write | ||
| contents: write | ||
| actions: write | ||
|
|
||
| jobs: | ||
| tagpr: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | ||
| with: | ||
| persist-credentials: true | ||
| ref: ${{ inputs.tag || github.ref }} | ||
|
|
||
| - id: tagpr | ||
| uses: Songmu/tagpr@9c294c8b7b1815a5f3b7c61d6ee6aa50ac25b030 # v1 | ||
| if: ${{ github.event_name != 'workflow_dispatch' }} # skip on workflow_dispatch | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
|
|
||
| - name: Run Go Releaser | ||
| uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6 | ||
| if: ${{ steps.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch' }} | ||
| with: | ||
| version: latest | ||
| args: release --clean | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,5 +18,11 @@ go.sum | |
| # related release files | ||
| pkg/ | ||
|
|
||
| # GoReleaser output | ||
| dist/ | ||
|
|
||
| vendor/ | ||
| *~ | ||
|
|
||
| CLAUDE.md | ||
| AGENTS.md | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # GoReleaser configuration for bqin | ||
| # https://goreleaser.com/ | ||
|
|
||
| version: 2 | ||
|
|
||
| builds: | ||
| - id: bqin | ||
| main: ./cmd/bqin | ||
| binary: bqin | ||
| env: | ||
| - CGO_ENABLED=0 | ||
| goos: | ||
| - linux | ||
| - darwin | ||
| - windows | ||
| goarch: | ||
| - amd64 | ||
| - arm64 | ||
| ignore: | ||
| - goos: windows | ||
| goarch: arm64 | ||
| ldflags: | ||
| - -s -w | ||
| - -X main.buildDate={{.Date}} | ||
|
|
||
| archives: | ||
| - name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}" | ||
| files: | ||
| - LICENSE | ||
| - README.md | ||
|
|
||
| checksum: | ||
| name_template: "checksums.txt" | ||
|
|
||
| snapshot: | ||
| version_template: "{{ incpatch .Version }}-next" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [tagpr] | ||
| vPrefix = true | ||
| releaseBranch = master | ||
| versionFile = version.go | ||
| release = draft |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| # Taskfile for bqin development | ||
| # https://taskfile.dev/ | ||
|
|
||
| version: "3" | ||
|
|
||
| vars: | ||
| VERSION: | ||
| sh: git describe --tags --always --dirty 2>/dev/null || echo "dev" | ||
| BUILD_DATE: | ||
| sh: date +%Y-%m-%dT%H:%M:%S%z | ||
| BINARY: bqin | ||
| MAIN_PATH: ./cmd/bqin | ||
| LDFLAGS: -s -w -X main.version={{.VERSION}} -X main.buildDate={{.BUILD_DATE}} | ||
|
|
||
| tasks: | ||
| default: | ||
| desc: Show available tasks | ||
| cmds: | ||
| - task -l | ||
| silent: true | ||
|
|
||
| deps: | ||
| desc: Download and tidy dependencies | ||
| cmds: | ||
| - go mod download | ||
| - go mod tidy | ||
|
|
||
| test: | ||
| desc: Run tests | ||
| cmds: | ||
| - go test -v -race -coverprofile=coverage.out ./... | ||
| sources: | ||
| - "**/*.go" | ||
| - go.mod | ||
| - go.sum | ||
|
|
||
| test:short: | ||
| desc: Run tests without race detector (faster) | ||
| cmds: | ||
| - go test -v ./... | ||
|
|
||
| coverage: | ||
| desc: Show test coverage in browser | ||
| deps: [test] | ||
| cmds: | ||
| - go tool cover -html=coverage.out | ||
|
|
||
| lint: | ||
| desc: Run linters (requires staticcheck) | ||
| cmds: | ||
| - go vet ./... | ||
| - staticcheck ./... | ||
| preconditions: | ||
| - sh: command -v staticcheck | ||
| msg: "staticcheck not found. Install with: go install honnef.co/go/tools/cmd/staticcheck@latest" | ||
|
|
||
| fmt: | ||
| desc: Format code | ||
| cmds: | ||
| - go fmt ./... | ||
|
|
||
| build: | ||
| desc: Build binary for current platform | ||
| cmds: | ||
| - go build -ldflags "{{.LDFLAGS}}" -o {{.BINARY}} {{.MAIN_PATH}} | ||
| sources: | ||
| - "**/*.go" | ||
| - go.mod | ||
| - go.sum | ||
| generates: | ||
| - "{{.BINARY}}" | ||
|
|
||
| install: | ||
| desc: Install binary to $GOPATH/bin | ||
| cmds: | ||
| - go install -ldflags "{{.LDFLAGS}}" {{.MAIN_PATH}} | ||
|
|
||
| clean: | ||
| desc: Clean build artifacts | ||
| cmds: | ||
| - rm -f {{.BINARY}} | ||
| - rm -f coverage.out | ||
| - rm -rf dist/ | ||
| - rm -rf pkg/ | ||
|
|
||
| run: | ||
| desc: Build and run (usage: task run -- [args]) | ||
| deps: [build] | ||
| cmds: | ||
| - ./{{.BINARY}} {{.CLI_ARGS}} | ||
|
|
||
| goreleaser:check: | ||
| desc: Check goreleaser config | ||
| cmds: | ||
| - goreleaser check | ||
| preconditions: | ||
| - sh: command -v goreleaser | ||
| msg: "goreleaser not found. Install from: https://goreleaser.com/install/" | ||
|
|
||
| goreleaser:build: | ||
| desc: Build with goreleaser (snapshot) | ||
| cmds: | ||
| - goreleaser build --snapshot --clean | ||
| preconditions: | ||
| - sh: command -v goreleaser | ||
| msg: "goreleaser not found. Install from: https://goreleaser.com/install/" | ||
|
|
||
| goreleaser:release: | ||
| desc: Create a local release with goreleaser (for testing) | ||
| cmds: | ||
| - goreleaser release --snapshot --clean | ||
| preconditions: | ||
| - sh: command -v goreleaser | ||
| msg: "goreleaser not found. Install from: https://goreleaser.com/install/" | ||
|
|
||
| ci: | ||
| desc: Run all CI checks (format, lint, test) | ||
| cmds: | ||
| - task: fmt | ||
| - task: lint | ||
| - task: test | ||
|
|
||
| help: | ||
| desc: Show detailed help | ||
| cmds: | ||
| - | | ||
| echo "bqin development tasks" | ||
| echo "" | ||
| echo "Common tasks:" | ||
| echo " task test - Run all tests" | ||
| echo " task build - Build binary" | ||
| echo " task install - Install to GOPATH" | ||
| echo " task lint - Run linters" | ||
| echo " task ci - Run all CI checks" | ||
| echo "" | ||
| echo "Development:" | ||
| echo " task run -- [args] - Build and run with arguments" | ||
| echo " task coverage - View test coverage" | ||
| echo "" | ||
| echo "Release:" | ||
| echo " task goreleaser:check - Validate goreleaser config" | ||
| echo " task goreleaser:build - Test build with goreleaser" | ||
| echo "" | ||
| echo "For full list: task -l" | ||
| silent: true | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| package bqin | ||
|
|
||
| var Version = "v0.3.1" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LDFLAGS references
main.version, but theversionvariable has been removed fromcmd/bqin/version.go. This will cause the linker flag to have no effect. Since the version is now sourced frombqin.Version, this linker flag should be removed or the variable should be kept for backward compatibility.