Serve the CI pipeline from the update server (marker config)
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
# The CI pipeline is served by the update server: GET /build/config?platform=ebitengine
|
||||||
|
platform: ebitengine
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
steps:
|
|
||||||
- name: version
|
|
||||||
image: alpine
|
|
||||||
commands:
|
|
||||||
- 'apk add --no-cache git make jq'
|
|
||||||
- 'make ci-version'
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: git.teletypegames.org/internal/ebitengine-builder:latest
|
|
||||||
commands:
|
|
||||||
- 'make ci-export'
|
|
||||||
|
|
||||||
- name: binaries
|
|
||||||
image: git.teletypegames.org/internal/ebitengine-builder:latest
|
|
||||||
commands:
|
|
||||||
- 'make ci-binaries'
|
|
||||||
|
|
||||||
- name: artifact
|
|
||||||
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'
|
|
||||||
@@ -12,7 +12,6 @@ OUTPUT_WASM = $(DIST_DIR)/$(WASM_NAME)
|
|||||||
OUTPUT_JS = $(DIST_DIR)/wasm_exec.js
|
OUTPUT_JS = $(DIST_DIR)/wasm_exec.js
|
||||||
OUTPUT_ZIP = $(PROJECT)-$(VERSION).html.zip
|
OUTPUT_ZIP = $(PROJECT)-$(VERSION).html.zip
|
||||||
|
|
||||||
VERSION_FILE = .version
|
|
||||||
INDEX_HTML_URL = https://git.teletypegames.org/tools/ebitengine-tools/raw/branch/master/web/index.html
|
INDEX_HTML_URL = https://git.teletypegames.org/tools/ebitengine-tools/raw/branch/master/web/index.html
|
||||||
|
|
||||||
# a mac-release lokális futtatásához (CI-ban a woodpecker env adja ugyanezeket)
|
# a mac-release lokális futtatásához (CI-ban a woodpecker env adja ugyanezeket)
|
||||||
@@ -149,41 +148,4 @@ watch:
|
|||||||
clean:
|
clean:
|
||||||
rm -rf $(BIN_DIR) $(DIST_DIR)
|
rm -rf $(BIN_DIR) $(DIST_DIR)
|
||||||
|
|
||||||
ci-version:
|
.PHONY: all build wasm export watch clean binaries binaries-mac mac-release binary-win-x86 binary-win-x64 binary-linux-x64 binary-mac-x64 binary-mac-arm64 binary-build binary-build-mac
|
||||||
@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-binaries:
|
|
||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
|
||||||
$(MAKE) binaries VERSION=$$VERSION
|
|
||||||
|
|
||||||
ci-upload:
|
|
||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
|
||||||
FILE="$(PROJECT)-$$VERSION.html.zip"; \
|
|
||||||
META_SRC="metadata.json"; \
|
|
||||||
META_DST="$(PROJECT)-$$VERSION.metadata.json"; \
|
|
||||||
BINS=$$(ls $(PROJECT)-$$VERSION-*.zip 2>/dev/null || true); \
|
|
||||||
cp $$META_SRC $$META_DST; \
|
|
||||||
for f in $$FILE $$META_DST $$BINS; 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=ebitengine&version=$$VERSION"
|
|
||||||
|
|
||||||
.PHONY: all build wasm export watch clean binaries binaries-mac mac-release binary-win-x86 binary-win-x64 binary-linux-x64 binary-mac-x64 binary-mac-arm64 binary-build binary-build-mac ci-version ci-export ci-binaries ci-upload ci-publish
|
|
||||||
|
|||||||
Reference in New Issue
Block a user