Skip to content

Merge pull request #42 from Unity-Technologies/feat/multi-log-targets… #323

Merge pull request #42 from Unity-Technologies/feat/multi-log-targets…

Merge pull request #42 from Unity-Technologies/feat/multi-log-targets… #323

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:
working-directory: './simple-game-server-go'
skip-go-installation: true
only-new-issues: 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 }}