Skip to content

Commit

Permalink
Merge pull request #3 from commentcov/fix_ci
Browse files Browse the repository at this point in the history
ci: fix gh-action configs to work
  • Loading branch information
terakoya76 authored Jun 13, 2022
2 parents ee0b3a9 + ea036f2 commit 79a9ce0
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release
on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: haya14busa/action-bumpr@v1
id: bumpr
if: "!startsWith(github.ref, 'refs/tags/')"

# Get tag name.
- uses: haya14busa/action-cond@v1
id: tag
with:
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
if_true: ${{ github.ref }}
if_false: ${{ steps.bumpr.outputs.next_version }}

- uses: actions/setup-go@v2
if: "steps.tag.outputs.value != ''"
with:
go-version: "1.18"

- uses: goreleaser/goreleaser-action@v1
if: "steps.tag.outputs.value != ''"
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
strategy:
matrix:
go: [1.16, 1.17, 1.18]
go: [1.18]
os: [ubuntu-20.04, ubuntu-22.04]

name: all
Expand All @@ -32,7 +32,7 @@ jobs:
- name: download dependencies
if: steps.cache-go-sum.outputs.cache-hit != 'true'
run: go mod download
run: go mod tidy

- name: lint
run: make lint
Expand Down
33 changes: 33 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
project_name: commentcov-plugin-go

env:
- GO111MODULE=on

before:
hooks:
- go mod tidy

builds:
- main: .
binary: commentcov-plugin-go
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Revision={{.ShortCommit}}
env:
- CGO_ENABLED=0

archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: darwin
linux: linux
windows: windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip

release:
prerelease: auto

0 comments on commit 79a9ce0

Please sign in to comment.