Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/changie-gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,22 @@ jobs:
echo "No changelog exists for this PR, creating a new one"
fi

- name: Install changie
- name: Set up Go
if: >-
github.event.workflow_run.conclusion == 'success' &&
steps.changelog_check.outputs.exists == 'false'
run: go install github.com/miniscruff/changie@v1.23.0
uses: actions/setup-go@v6
with:
go-version-file: 'src/go.mod'
cache-dependency-path: src/go.sum

- name: Create changie log
if: >-
github.event.workflow_run.conclusion == 'success' &&
steps.changelog_check.outputs.exists == 'false'
env:
CHANGIE_BODY: ${{ github.event.workflow_run.display_title }}
run: changie new --kind Dependency --body "$CHANGIE_BODY"
run: $(cd src && go tool -n changie) new --kind Dependency --body "$CHANGIE_BODY"

- name: Commit & Push changes
if: >-
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ jobs:
then
echo "Skip Changie..."
else
go install github.com/miniscruff/changie@v1.23.0
changie batch ${{ steps.version.outputs.RELEASE_VERSION }}
changie merge
CHANGIE=$(cd src && go tool -n changie)
$CHANGIE batch ${{ steps.version.outputs.RELEASE_VERSION }}
$CHANGIE merge
git add .
git commit -m "Cut Release '${{ steps.version.outputs.RELEASE_VERSION }}'"
git push origin HEAD
Expand Down
65 changes: 6 additions & 59 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,29 @@ tasks:
desc: Workflow to run in CI
cmds:
- task: workspace
- task: install-gofumpt
- task: install-golangci-lint
- task: lint
- task: test

lint:
desc: Formatting and linting
dir: "{{.SRC_DIR}}"
cmds:
- test -z "$(gofumpt -d -e . | tee /dev/stderr)"
- test -z "$(go tool gofumpt -d -e . | tee /dev/stderr)"
- go vet ./...
- golangci-lint run
- go tool golangci-lint run

fix:
desc: Fix formatting and linting
dir: "{{.SRC_DIR}}"
cmds:
- task: update-opslevel-go
- gofumpt -w .
- go tool gofumpt -w .
- go mod tidy
- golangci-lint run --fix
- go tool golangci-lint run --fix

setup:
desc: Setup linter, formatter, etc. for local testing and CI
desc: Setup workspace for local development
cmds:
- cmd: echo "Installing development tools..."
silent: true
- task: install-changie
- task: install-gofumpt
- task: install-golangci-lint
- cmd: echo "Development tools installed!"
silent: true
- task: workspace

test:
Expand Down Expand Up @@ -74,56 +65,12 @@ tasks:
desc: Start Faktory and opslevel-runner in faktory mode
dir: "{{.SRC_DIR}}"
deps:
- install-goreman
- install-faktory
cmds:
- goreman start
- go tool goreman start

# internal (not directly called) tasks

go-install-tool:
desc: go install '{{.GO_TOOL}}' and set GOBIN if not set
internal: true
silent: true
vars:
IS_TOOL_INSTALLED:
sh: which {{.GO_TOOL}} > /dev/null || echo "1"
cmds:
- test -z "{{.IS_TOOL_INSTALLED}}" || echo "Installing {{.GO_TOOL}}..."
- test -z "{{.IS_TOOL_INSTALLED}}" || go install {{.GO_TOOL_PATH}}
- test -n $(go env GOBIN) || go env -w GOBIN=$(go env GOPATH)/bin
- echo " '{{.GO_TOOL}}' is installed."
requires:
vars: [GO_TOOL, GO_TOOL_PATH]

install-changie:
desc: go install "changie"
internal: true
cmds:
- task: go-install-tool
vars: { GO_TOOL: "changie", GO_TOOL_PATH: "github.com/miniscruff/changie@v1.23.0" }

install-gofumpt:
desc: go install "gofumpt"
internal: true
cmds:
- task: go-install-tool
vars: { GO_TOOL: "gofumpt", GO_TOOL_PATH: "mvdan.cc/gofumpt@latest" }

install-golangci-lint:
desc: go install "golangci-lint"
internal: true
cmds:
- task: go-install-tool
vars: { GO_TOOL: "golangci-lint", GO_TOOL_PATH: "github.com/golangci/golangci-lint/cmd/golangci-lint@latest" }

install-goreman:
desc: go install "goreman"
internal: true
cmds:
- task: go-install-tool
vars: { GO_TOOL: "goreman", GO_TOOL_PATH: "github.com/mattn/goreman@latest" }

install-redis:
desc: install "redis-server"
internal: true
Expand Down
Loading
Loading