Compare commits

..

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

7 changed files with 15 additions and 74 deletions

1
.gitignore vendored
View File

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

View File

@ -1,6 +1,5 @@
stages:
- test
- build
- push
Run unit tests:
@ -38,19 +37,6 @@ Generage coverage XML:
coverage_format: cobertura
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:
stage: push
needs: ["Run unit tests"]

View File

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

View File

@ -2,34 +2,19 @@
set -e
cd $(dirname $0)
base=../..
cd $(dirname $0)/../..
VERSION=$(cat $base/CHANGELOG.md | awk -F '[][]' '/^## \[/ {print $2; exit}')
GO_VERSION=$(cat $base/go.mod | sed -n 's/^go //p')
PODMAN=$(command -v podman || echo docker)
VERSION=$(cat 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
)
tag=dirtbags/moth:$VERSION
echo "==== Building $tag"
docker build \
--build-arg GO_VERSION=$GO_VERSION \
for target in moth; do
tag=dirtbags/$target:$VERSION
echo "==== Building $tag"
$PODMAN build \
--build-arg http_proxy --build-arg https_proxy --build-arg no_proxy \
--tag $tag \
-f Containerfile $base
--target $target \
-f build/package/Containerfile .
done
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
go 1.21
go 1.13
require (
github.com/kr/text v0.2.0 // indirect