Skip to content

using golangci-lint v2 #315

using golangci-lint v2

using golangci-lint v2 #315

name: simple-game-server-go
on:
pull_request:
push:
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './simple-game-server-go'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.20'
- name: Lint
uses: golangci/golangci-lint-action@v8
with:
version: v1.52.2
working-directory: './simple-game-server-go'
skip-go-installation: true
- name: Build
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/') == false
with:
distribution: goreleaser
version: v1.18.2
args: build --rm-dist --snapshot
workdir: './simple-game-server-go'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: 'go test -timeout=5m -race -v ./...'
- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-simple-game-server-go') }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Release
uses: goreleaser/goreleaser-action@v2
if: ${{ startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-simple-game-server-go') }}
with:
distribution: goreleaser
version: v1.18.2
args: release --rm-dist
workdir: './simple-game-server-go'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}