diff --git a/.gitignore b/.gitignore index 025ba50..f022b13 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 1348362..d9f6a88 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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 diff --git a/Dockerfile b/docker/Dockerfile similarity index 94% rename from Dockerfile rename to docker/Dockerfile index 60531fc..e43fc2a 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 AS build_image +FROM golang:1.24 AS build_image WORKDIR /usr/src/app diff --git a/docker/Taskfile.docker.yml b/docker/Taskfile.docker.yml new file mode 100644 index 0000000..f234760 --- /dev/null +++ b/docker/Taskfile.docker.yml @@ -0,0 +1,23 @@ +version: '3' + +tasks: + build: + desc: Build the Docker image + cmds: + - docker build -t q3rcon-proxy -f docker/Dockerfile . + dir: . + + login: + desc: Login to Github Container Registry + cmds: + - docker login ghcr.io -u onyx-and-iris --password-stdin <<< {{.GHCR_TOKEN}} + internal: true + + push: + desc: Push the Docker image to Github Container Registry + deps: + - task: build + - task: login + cmds: + - docker tag q3rcon-proxy ghcr.io/onyx-and-iris/q3rcon-proxy:latest + - docker push ghcr.io/onyx-and-iris/q3rcon-proxy:latest diff --git a/go.mod b/go.mod index 5863f02..2639bfc 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/onyx-and-iris/q3rcon-proxy -go 1.23.0 +go 1.24.0 toolchain go1.24.1