diff --git a/.woodpecker.yaml b/.woodpecker.yaml index e7accac..46286f9 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -1,31 +1,2 @@ -steps: - - name: version - image: alpine - commands: - - apk add --no-cache git make jq - - make ci-version - - - name: build - image: git.teletypegames.org/internal/phaser-builder:latest - commands: - - make ci-export - - - name: upload - image: alpine - environment: - UPDATE_SERVER: https://teletypegames.org - UPDATE_SECRET: - from_secret: update_secret_key - commands: - - apk add --no-cache make curl - - make ci-upload - - - name: publish - image: alpine - environment: - UPDATE_SERVER: https://teletypegames.org - UPDATE_SECRET: - from_secret: update_secret_key - commands: - - apk add --no-cache make curl - - make ci-publish +# The CI pipeline is served by the update server: GET /build/config?platform=phaser +platform: phaser diff --git a/Makefile b/Makefile index d12cb72..a1396be 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,6 @@ PROJECT = trickster-tiles DIST_DIR = dist OUTPUT_ZIP = $(PROJECT)-$(VERSION).html.zip -VERSION_FILE = .version - all: build node_modules: package.json package-lock.json @@ -42,36 +40,4 @@ watch: clean: rm -rf $(DIST_DIR) -ci-version: - @if [ -f metadata.json ]; then \ - VERSION=$$(jq -r '.version' metadata.json); \ - else \ - VERSION=$$(git rev-parse --short HEAD); \ - fi; \ - BRANCH=$$(git rev-parse --abbrev-ref HEAD); \ - if [ "$$BRANCH" != "main" ] && [ "$$BRANCH" != "master" ]; then \ - VERSION="dev-$$VERSION-$$BRANCH"; \ - fi; \ - echo $$VERSION > $(VERSION_FILE) - -ci-export: - @VERSION=$$(cat $(VERSION_FILE)); \ - $(MAKE) export VERSION=$$VERSION - -ci-upload: - @VERSION=$$(cat $(VERSION_FILE)); \ - FILE="$(PROJECT)-$$VERSION.html.zip"; \ - META_SRC="metadata.json"; \ - META_DST="$(PROJECT)-$$VERSION.metadata.json"; \ - cp $$META_SRC $$META_DST; \ - for f in $$FILE $$META_DST; do \ - curl -fsS -H "X-Update-Secret: $(UPDATE_SECRET)" \ - -F "file=@$$f" \ - "$(UPDATE_SERVER)/build/upload?name=$(PROJECT)&version=$$VERSION" || exit 1; \ - done - -ci-publish: - @VERSION=$$(cat $(VERSION_FILE)); \ - curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?name=$(PROJECT)&platform=phaser&version=$$VERSION" - -.PHONY: all build web serve dev export watch clean ci-version ci-export ci-upload ci-publish +.PHONY: all build web serve dev export watch clean