Compare commits

...

2 Commits

Author SHA1 Message Date
16e5e9c010 upd vars 2025-03-16 01:34:01 +00:00
916d2a2d86 add docker tasks 2025-03-16 01:04:16 +00:00
5 changed files with 37 additions and 7 deletions

9
.gitignore vendored
View File

@ -1,3 +1,5 @@
# Auto-generated .gitignore by gignore: github.com/onyx-and-iris/gignore
### Go ###
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
@ -20,10 +22,7 @@ bin/
# Go workspace file
go.work
# End of gignore: github.com/onyx-and-iris/gignore
# Added by goreleaser init:
dist/
# testing
run.sh
server.yaml
dist/

View File

@ -1,5 +1,8 @@
version: '3'
includes:
docker: ./docker/Taskfile.docker.yml
vars:
PROGRAM: q3rcon-proxy
SHELL: '{{if eq .OS "Windows_NT"}}powershell{{end}}'
@ -38,11 +41,13 @@ tasks:
desc: Build the q3rcon-proxy project for Windows
cmds:
- GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/
internal: true
build-linux:
desc: Build the q3rcon-proxy project for Linux
cmds:
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/
internal: true
test:
desc: Run tests

View File

@ -1,4 +1,4 @@
FROM golang:1.21 AS build_image
FROM golang:1.24 AS build_image
WORKDIR /usr/src/app

View File

@ -0,0 +1,26 @@
version: '3'
vars:
IMAGE: q3rcon-proxy
tasks:
build:
desc: Build the Docker image
cmds:
- docker build -t {{.IMAGE}} -f docker/Dockerfile .
dir: .
login:
desc: Login to Github Container Registry
cmds:
- docker login ghcr.io -u {{.GHCR_USER}} --password-stdin <<< {{.GHCR_TOKEN}}
internal: true
push:
desc: Push the Docker image to Github Container Registry
deps:
- task: build
- task: login
cmds:
- docker tag {{.IMAGE}} ghcr.io/{{.GHCR_USER}}/{{.IMAGE}}:latest
- docker push ghcr.io/{{.GHCR_USER}}/{{.IMAGE}}:latest

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/onyx-and-iris/q3rcon-proxy
go 1.23.0
go 1.24.0
toolchain go1.24.1