Skip to content

chore(deps): update cycjimmy/semantic-release-action action to v4 #66

chore(deps): update cycjimmy/semantic-release-action action to v4

chore(deps): update cycjimmy/semantic-release-action action to v4 #66

Workflow file for this run

---
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: lint
uses: reviewdog/action-golangci-lint@v2
test:
strategy:
matrix:
go_version:
- 1.16.x
- 1.17.x
- 1.18.x
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go_version }}
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go_version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go_version }}
- name: test
run: go test -v -race -coverprofile=cover.os-${{ matrix.os }}.ver-${{ matrix.go_version }}.txt -covermode=atomic ./...
- name: upload coverage
uses: codecov/codecov-action@v3
if: ${{ matrix.os == 'ubuntu-latest' && matrix.go_version == '1.18.x' }}
with:
files: ./cover.os-${{ matrix.os }}.ver-${{ matrix.go_version }}.txt
determine_release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
outputs:
will_release: ${{ steps.determine_release.outputs.new_release_published }}
steps:
- uses: actions/checkout@v3
- id: determine_release
uses: cycjimmy/[email protected]
with:
dry_run: true
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
release:
runs-on: ubuntu-latest
needs:
- test
- lint
- determine_release
if: ${{ needs.determine_release.outputs.will_release }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: cycjimmy/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/setup-go@v3
with:
go-version: '1.18.x'
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go_version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go_version }}
- uses: goreleaser/[email protected]
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ github.token }}