mirror of https://github.com/dirtbags/moth.git
Compare commits
6 Commits
4710b6927a
...
60fdb0ddd8
Author | SHA1 | Date |
---|---|---|
Neale Pickett | 60fdb0ddd8 | |
Neale Pickett | cc0e5bba94 | |
Neale Pickett | 535276446c | |
Neale Pickett | 7418a3c224 | |
Neale Pickett | 05ed4f315c | |
Neale Pickett | fa049db1a2 |
|
@ -6,3 +6,4 @@ __debug_bin
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
transpile
|
transpile
|
||||||
mothd
|
mothd
|
||||||
|
winmoth.*.zip
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
|
- build
|
||||||
- push
|
- push
|
||||||
|
|
||||||
Run unit tests:
|
Run unit tests:
|
||||||
|
@ -37,6 +38,19 @@ 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,4 +1,5 @@
|
||||||
FROM golang:1 AS builder
|
ARG GO_VERSION=1.21-alpine
|
||||||
|
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,19 +2,34 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cd $(dirname $0)/../..
|
cd $(dirname $0)
|
||||||
|
base=../..
|
||||||
|
|
||||||
PODMAN=$(command -v podman || echo docker)
|
VERSION=$(cat $base/CHANGELOG.md | awk -F '[][]' '/^## \[/ {print $2; exit}')
|
||||||
VERSION=$(cat CHANGELOG.md | awk -F '[][]' '/^## \[/ {print $2; exit}')
|
GO_VERSION=$(cat $base/go.mod | sed -n 's/^go //p')
|
||||||
|
|
||||||
for target in moth; do
|
(
|
||||||
tag=dirtbags/$target:$VERSION
|
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"
|
echo "==== Building $tag"
|
||||||
$PODMAN build \
|
docker 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 \
|
||||||
--target $target \
|
-f Containerfile $base
|
||||||
-f build/package/Containerfile .
|
|
||||||
done
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
mkdir state
|
||||||
|
mkdir puzzles
|
||||||
|
echo devel > state/teamids.txt
|
||||||
|
.\mothd.exe -puzzles puzzles
|
|
@ -0,0 +1,24 @@
|
||||||
|
#! /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