Skip to content

tag: v0.19.6

tag: v0.19.6 #315

Workflow file for this run

name: Test/Tag
on:
pull_request:
push:
branches:
- main
jobs:
# unit-test-windows:
# if: ${{ !startsWith(github.event.head_commit.message, 'tag') }}
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v4
# with:
# go-version: '1.21'
# - name: Test
# run: go test -v ./...
unit-test-linux:
if: ${{ !startsWith(github.event.head_commit.message, 'tag') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Test
run: go test -v -covermode=count -coverprofile=.coverage.out ./... -coverpkg=./...
- name: Coveralls upload
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: .coverage.out
lint:
if: ${{ !startsWith(github.event.head_commit.message, 'tag') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
- run: golangci-lint run -v
tag:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- unit-test-linux
# - unit-test-windows
- lint
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0' # https://github.com/actions/checkout/issues/217
token: ${{ secrets.CI_TOKEN }}
- name: Tag
run: |
version=$(.github/semver.sh)
git config user.name github-actions
git config user.email [email protected]
sed "s/\"v[0-9]*\.[0-9]*\.[0-9]*\"/\"$version\"/" cmd/root.go > cmd/_root.go
mv cmd/_root.go cmd/root.go
git add cmd/root.go
git commit -m "tag: $version"
git tag "$version"
git push
git push --tags