mirror of https://github.com/dirtbags/moth.git
Compare commits
No commits in common. "60fdb0ddd858beca89c69f35a85dc13940ed4ae0" and "4710b6927a44b52f5f5c520899b12c82fe87eae3" have entirely different histories.
60fdb0ddd8
...
4710b6927a
|
@ -6,4 +6,3 @@ __debug_bin
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
transpile
|
transpile
|
||||||
mothd
|
mothd
|
||||||
winmoth.*.zip
|
|
||||||
|
|
|
@ -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"]
|
||||||
|
|
|
@ -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/
|
||||||
|
|
|
@ -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"
|
|
||||||
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"
|
echo "==== Building $tag"
|
||||||
docker build \
|
$PODMAN build \
|
||||||
--build-arg GO_VERSION=$GO_VERSION \
|
|
||||||
--build-arg http_proxy --build-arg https_proxy --build-arg no_proxy \
|
--build-arg http_proxy --build-arg https_proxy --build-arg no_proxy \
|
||||||
--tag $tag \
|
--tag $tag \
|
||||||
-f Containerfile $base
|
--target $target \
|
||||||
|
-f build/package/Containerfile .
|
||||||
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
mkdir state
|
|
||||||
mkdir puzzles
|
|
||||||
echo devel > state/teamids.txt
|
|
||||||
.\mothd.exe -puzzles puzzles
|
|
|
@ -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
|
|
||||||
)
|
|
Loading…
Reference in New Issue