Skip to content

chore(ci): only release after CI on main passes #117

chore(ci): only release after CI on main passes

chore(ci): only release after CI on main passes #117

Workflow file for this run

on:
push:
branches:
- main
pull_request:
name: CI
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
GOPROXY: direct
steps:
- uses: actions/checkout@v4
- uses: cashapp/activate-hermit@v1
- run: |
find . -name go.mod | grep -v /testdata | xargs -n1 dirname | while read dir; do (
cd "$dir"
go mod tidy
go test -v ./...
); done
git diff
lint:
name: Lint
runs-on: ubuntu-latest
env:
GOPROXY: direct
steps:
- uses: actions/checkout@v4
- uses: cashapp/activate-hermit@v1
- run: |
find . -name go.mod | grep -v /testdata | xargs -n1 dirname | while read dir; do (
cd "$dir"
go mod tidy
golangci-lint run
); done
git diff
release:
if: github.ref == 'refs/heads/main'
needs: ["test", "lint"]
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cashapp/activate-hermit@v1
- uses: charlesthomas/github-action-svu@v1.0.5+2.1.1
id: svu
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
git tag ${{ steps.svu.outputs.next }}
goreleaser release --fail-fast
git push --tags
if: ${{ steps.svu.outputs.changed == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}