Skip to content

chore: add release automation #1

chore: add release automation

chore: add release automation #1

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
on:
push:
branches:
- main
pull_request: {}
jobs:
check-generated:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- run: |
go mod tidy
go generate ./...
git diff --exit-code
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- run: |
go install
go test -cover ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- uses: golangci/golangci-lint-action@v4
with:
version: v1.59.1
release-please:
runs-on: ubuntu-latest
needs: [generate, test, lint]

Check failure on line 46 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yaml

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 46, Col: 13): Job 'release-please' depends on unknown job 'generate'. .github/workflows/ci.yaml (Line: 61, Col: 13): Job 'release' depends on job 'release-please' which creates a cycle in the dependency graph.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }}
version: ${{ steps.release-please.outputs.version }}
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.PAT }}
release-type: go
bump-minor-pre-major: true
release:
runs-on: ubuntu-latest
needs: [release-please]
if: needs.release-please.outputs.release_created
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --tags --force
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}