Compare commits

..

No commits in common. "60fdb0ddd858beca89c69f35a85dc13940ed4ae0" and "4710b6927a44b52f5f5c520899b12c82fe87eae3" have entirely different histories.

7 changed files with 15 additions and 74 deletions

3
.gitignore vendored
View File

@ -5,5 +5,4 @@
__debug_bin __debug_bin
*.tar.gz *.tar.gz
transpile transpile
mothd mothd
winmoth.*.zip

View File

@ -1,6 +1,5 @@
stages: stages:
- test - test
- build
- push - push
Run unit tests: Run unit tests:
@ -38,19 +37,6 @@ Generage coverage XML:
coverage_format: cobertura coverage_format: cobertura
path: coverage.xml path: coverage.xml
winbuild:
stage: build
image: *goimage
needs: ["Run unit tests"]
script:
- GOOS=windows GOARCH=amd64 go build ./cmd/mothd
- cp build/package/moth-devel.bat .
artifacts:
paths:
- mothd.exe
- moth-devel.bat
- theme/*
push: push:
stage: push stage: push
needs: ["Run unit tests"] needs: ["Run unit tests"]

View File

@ -1,5 +1,4 @@
ARG GO_VERSION=1.21-alpine FROM golang:1 AS builder
FROM docker.io/library/golang:${GO_VERSION} AS builder
COPY go.* /src/ COPY go.* /src/
COPY pkg /src/pkg/ COPY pkg /src/pkg/
COPY cmd /src/cmd/ COPY cmd /src/cmd/

View File

@ -2,34 +2,19 @@
set -e set -e
cd $(dirname $0) cd $(dirname $0)/../..
base=../..
VERSION=$(cat $base/CHANGELOG.md | awk -F '[][]' '/^## \[/ {print $2; exit}') PODMAN=$(command -v podman || echo docker)
GO_VERSION=$(cat $base/go.mod | sed -n 's/^go //p') VERSION=$(cat CHANGELOG.md | awk -F '[][]' '/^## \[/ {print $2; exit}')
( for target in moth; do
zipfile=winmoth.$VERSION.zip tag=dirtbags/$target:$VERSION
echo "=== Building $zipfile" echo "==== Building $tag"
mkdir -p winmoth winmoth/state winmoth/puzzles winmoth/mothballs $PODMAN build \
echo devel > winmoth/state/teamids.txt --build-arg http_proxy --build-arg https_proxy --build-arg no_proxy \
cp moth-devel.bat winmoth --tag $tag \
cp -a $base/theme winmoth --target $target \
( -f build/package/Containerfile .
cd winmoth done
GOOS=windows GOARCH=amd64 go build ../$base/cmd/mothd/...
)
zip -r $zipfile winmoth
rm -rf winmoth
)
tag=dirtbags/moth:$VERSION
echo "==== Building $tag"
docker build \
--build-arg GO_VERSION=$GO_VERSION \
--build-arg http_proxy --build-arg https_proxy --build-arg no_proxy \
--tag $tag \
-f Containerfile $base
exit 0 exit 0

View File

@ -1,4 +0,0 @@
mkdir state
mkdir puzzles
echo devel > state/teamids.txt
.\mothd.exe -puzzles puzzles

View File

@ -1,24 +0,0 @@
#! /bin/sh
set -e
cd $(dirname $0)
base=../..
VERSION=$(cat $base/CHANGELOG.md | awk -F '[][]' '/^## \[/ {print $2; exit}')
(
zipfile=winmoth.$VERSION.zip
echo "=== Building $zipfile"
mkdir -p winmoth winmoth/state winmoth/puzzles winmoth/mothballs
echo devel > winmoth/state/teamids.txt
cp moth-devel.bat winmoth
cp -a $base/theme winmoth
(
cd winmoth
GOOS=windows GOARCH=amd64 go build ../$base/cmd/mothd/...
)
zip -r $zipfile winmoth
rm -rf winmoth
)

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/dirtbags/moth/v4 module github.com/dirtbags/moth/v4
go 1.21 go 1.13
require ( require (
github.com/kr/text v0.2.0 // indirect github.com/kr/text v0.2.0 // indirect