chore(ci): enabled initial development versions in semantic release #77
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
| name: Test, Build and Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24.3' | |
| - name: Ensure go mod tidy has zero output | |
| run: go mod tidy -v && git diff --exit-code | |
| - name: Ensure gofumpt has zero output | |
| run: | | |
| go install mvdan.cc/gofumpt@latest | |
| gofumpt -l -w . | |
| git diff --exit-code | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v3 | |
| with: | |
| version: latest | |
| skip-pkg-cache: true | |
| args: --issues-exit-code=0 | |
| - name: Run Units Tests | |
| run: | | |
| go test -v -coverpkg=./... ./... | |
| release: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24.3' | |
| - name: Fetch all tags and history | |
| run: git fetch --prune --tags --force | |
| - name: Run go-semantic-release | |
| uses: go-semantic-release/action@v1 | |
| with: | |
| hooks: goreleaser | |
| allow-initial-development-versions: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |