-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bc7f0c
commit f4095a9
Showing
7 changed files
with
129 additions
and
79 deletions.
There are no files selected for viewing
This file contains 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 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,49 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
uses: FollowTheProcess/msg/.github/workflows/CI.yml@main | ||
secrets: inherit | ||
permissions: | ||
contents: read | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
|
||
needs: | ||
- ci | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Fetch Existing Tags | ||
run: git fetch --force --tags | ||
|
||
- name: Parse Release Version | ||
id: version | ||
run: | | ||
VERSION=${GITHUB_REF#refs/tags/v} | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Publish Draft Release | ||
uses: release-drafter/release-drafter@v6 | ||
with: | ||
version: ${{ steps.version.outputs.version }} | ||
publish: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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 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,66 @@ | ||
# https://taskfile.dev | ||
|
||
version: "3" | ||
|
||
vars: | ||
COV_DATA: coverage.out | ||
|
||
tasks: | ||
default: | ||
desc: List all available tasks | ||
silent: true | ||
cmd: task --list | ||
|
||
tidy: | ||
desc: Tidy dependencies in go.mod and go.sum | ||
cmd: go mod tidy | ||
|
||
fmt: | ||
desc: Run go fmt on all source files | ||
cmd: go fmt ./... | ||
|
||
test: | ||
desc: Run the test suite | ||
cmd: go test -race ./... {{ .CLI_ARGS }} | ||
|
||
bench: | ||
desc: Run all project benchmarks | ||
cmd: go test ./... -run None -benchmem -bench . {{ .CLI_ARGS }} | ||
|
||
lint: | ||
desc: Run the linters and auto-fix if possible | ||
cmd: golangci-lint run --fix | ||
preconditions: | ||
- sh: command -v golangci-lint | ||
msg: golangci-lint not installed, see https://golangci-lint.run/usage/install/#local-installation | ||
|
||
doc: | ||
desc: Render the pkg docs locally | ||
cmd: pkgsite -open | ||
preconditions: | ||
- sh: command -v pkgsite | ||
msg: pkgsite not installed, run go install golang.org/x/pkgsite/cmd/pkgsite@latest | ||
|
||
cov: | ||
desc: Calculate test coverage and render the html | ||
generates: | ||
- "{{ .COV_DATA }}" | ||
cmds: | ||
- go test -race -cover -covermode atomic -coverprofile {{ .COV_DATA }} ./... | ||
- go tool cover -html {{ .COV_DATA }} | ||
|
||
check: | ||
desc: Run tests and linting in one | ||
cmds: | ||
- task: test | ||
- task: lint | ||
|
||
sloc: | ||
desc: Print lines of code | ||
cmd: fd . -e go | xargs wc -l | sort -nr | head | ||
|
||
clean: | ||
desc: Remove build artifacts and other clutter | ||
cmds: | ||
- go clean ./... | ||
- rm -rf {{ .COV_DATA }} |
This file contains 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 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