feat: add python base version #15
Workflow file for this run
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
name: Build Test and Release | |
on: | |
push: | |
branches: | |
- main | |
- beta | |
- "feature/*" | |
- "fix/*" | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ^1.14 | |
id: go | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Run go build | |
run: go build -v ./... | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ^1.18 | |
id: go | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Test | |
run: go test -v -race ./... | |
- name: Go Vet | |
run: go vet ./... | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ^1.14 | |
id: go | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Run golangci-lint # https://github.com/marketplace/actions/run-golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.50 | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [build, test, lint] | |
if: contains(github.ref, 'main') | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ^1.14 | |
id: go | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v0.9.15 | |
with: | |
versionSpec: "5.x" | |
- name: Version with GitVersion # https://github.com/marketplace/actions/use-actions | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v0.9.15 | |
- name: Bump version and push tag # https://github.com/marketplace/actions/github-tag | |
id: tag_version | |
uses: mathieudutour/github-tag-action@v6.1 | |
if: ${{ steps.gitversion.outputs.PreReleaseTagWithDash == '' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: ${{ steps.gitversion.outputs.FullSemVer }} | |
release_branches: main | |
tag_prefix: v | |
- name: Check out code | |
uses: actions/checkout@v3 | |
if: ${{ steps.gitversion.outputs.PreReleaseTagWithDash == '' }} | |
with: | |
fetch-depth: 0 | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
if: ${{ steps.gitversion.outputs.PreReleaseTagWithDash == '' }} | |
with: | |
version: latest | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |