goveal/.github/workflows/go.yml

62 lines
1.2 KiB
YAML
Raw Normal View History

2020-12-05 11:08:10 +00:00
name: Go
2021-12-26 10:58:59 +00:00
on:
push:
tags:
- v*
branches:
- main
pull_request:
2020-12-05 11:08:10 +00:00
2022-03-15 17:04:55 +00:00
permissions:
contents: write
issues: write
packages: write
pull-requests: read
2020-12-05 11:08:10 +00:00
2022-03-15 17:04:55 +00:00
jobs:
2020-12-05 11:08:10 +00:00
build:
name: Build
runs-on: ubuntu-latest
steps:
2022-03-15 19:22:04 +00:00
- name: Set up Go 1.18
2022-03-15 17:04:55 +00:00
uses: actions/setup-go@v3
2020-12-05 11:08:10 +00:00
with:
2022-03-15 19:22:04 +00:00
go-version: '^1.18'
2020-12-05 11:08:10 +00:00
id: go
2022-03-15 17:04:55 +00:00
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
2022-03-15 17:04:55 +00:00
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
2020-12-05 11:08:10 +00:00
- name: Check out code into the Go module directory
2022-03-15 15:35:16 +00:00
uses: actions/checkout@v3
2020-12-05 11:08:10 +00:00
with:
lfs: true
2022-03-15 17:04:55 +00:00
fetch-depth: 0
2020-12-05 11:08:10 +00:00
- name: Install Task
2021-11-12 12:34:54 +00:00
uses: arduino/setup-task@v1
2022-03-15 17:04:55 +00:00
- name: Download assets
run: task download-assets
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
2020-12-05 11:08:10 +00:00
- name: Build & test
2022-03-15 17:04:55 +00:00
run: task test
2020-12-05 11:08:10 +00:00
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
2020-12-05 11:08:10 +00:00
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}