Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cce41e8fd | ||
|
|
5964d3477b | ||
|
|
86fac8e96c |
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
DOCKER_REPO=git.shmyga.ru
|
DOCKER_REPO=git.shmyga.ru
|
||||||
DOCKER_GROUP=infernalgames
|
DOCKER_GROUP=infernalgames
|
||||||
|
|
||||||
PUBLISH_REPO=git.shmyga.ru
|
PUBLISH_REPO=https://git.shmyga.ru/api/packages/InfernalGames
|
||||||
PUBLISH_GROUP=InfernalGames
|
|
||||||
|
|||||||
@@ -17,27 +17,26 @@ jobs:
|
|||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- run: echo '' > requirements.txt
|
- run: echo '' > requirements.txt
|
||||||
- uses: https://git.shmyga.ru/InfernalGames/project-manager@master
|
- uses: https://git.shmyga.ru/InfernalGames/project-manager@master
|
||||||
- uses: actions/cache/restore@v6
|
- name: Restore haxe cache
|
||||||
id: cache-haxe
|
id: cache-haxe-restore
|
||||||
|
uses: actions/cache/restore@v6
|
||||||
with:
|
with:
|
||||||
key: ${{ runner.os }}-haxe-${{ hashFiles('**/haxetool.json') }}-v1
|
key: ${{ runner.os }}-haxe
|
||||||
path: /root/sdk
|
path: |
|
||||||
- uses: actions/cache/restore@v6
|
$HOME/sdk
|
||||||
id: cache-haxe-build
|
./build
|
||||||
with:
|
|
||||||
key: ${{ runner.os }}-haxe-build
|
|
||||||
path: ./build
|
|
||||||
- run: echo "${{ secrets.KEY_STORE }}" | base64 --decode > keystore.jks
|
- run: echo "${{ secrets.KEY_STORE }}" | base64 --decode > keystore.jks
|
||||||
- run: pm build:docker -vv
|
- run: pm build:docker -vv
|
||||||
- if: steps.cache-haxe.outputs.cache-hit != 'true'
|
- name: Save haxe cache
|
||||||
|
id: cache-haxe-save
|
||||||
|
#if: always() && steps.cache-haxe-restore.outputs.cache-hit != 'true'
|
||||||
|
if: always()
|
||||||
uses: actions/cache/save@v6
|
uses: actions/cache/save@v6
|
||||||
with:
|
with:
|
||||||
key: ${{ steps.cache-haxe.outputs.cache-primary-key }}
|
key: ${{ steps.cache-haxe-restore.outputs.cache-primary-key }}
|
||||||
path: /root/sdk
|
path: |
|
||||||
- uses: actions/cache/save@v6
|
$HOME/sdk
|
||||||
with:
|
./build
|
||||||
key: ${{ steps.cache-haxe-build.outputs.cache-primary-key }}
|
|
||||||
path: ./build
|
|
||||||
- uses: docker/login-action@v4
|
- uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
registry: git.shmyga.ru
|
registry: git.shmyga.ru
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
name: test
|
|
||||||
|
|
||||||
on: push
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v7
|
|
||||||
- run: echo '' > requirements.txt
|
|
||||||
- uses: https://git.shmyga.ru/InfernalGames/project-manager@haxetool
|
|
||||||
with:
|
|
||||||
setup-haxetool: true
|
|
||||||
- run: pm lint -vv
|
|
||||||
@@ -1,5 +1,13 @@
|
|||||||
modules = ["."]
|
modules = ["."]
|
||||||
|
|
||||||
|
#[presets.haxe]
|
||||||
|
#variables.haxe_sources = [
|
||||||
|
# "./src/common/haxe",
|
||||||
|
# "./src/app/haxe",
|
||||||
|
# "./src/server/haxe",
|
||||||
|
#]
|
||||||
|
#tasks = {}
|
||||||
|
|
||||||
[presets.docker]
|
[presets.docker]
|
||||||
variables.docker_target = "web"
|
variables.docker_target = "web"
|
||||||
variables.docker_build_args = { PROJECT_NAME = "{{ project_name }}" }
|
variables.docker_build_args = { PROJECT_NAME = "{{ project_name }}" }
|
||||||
@@ -8,11 +16,12 @@ variables.docker_name = "{{ project_name }}-web"
|
|||||||
[presets.docker.tasks.build.compose]
|
[presets.docker.tasks.build.compose]
|
||||||
priority = 1
|
priority = 1
|
||||||
variables.sdk_path = "{{ 'SDK_PATH' | env('$HOME/sdk') }}"
|
variables.sdk_path = "{{ 'SDK_PATH' | env('$HOME/sdk') }}"
|
||||||
|
variables.publish_path = "{{ 'PUBLISH_PATH' | env('$HOME/public/' + project_name) }}"
|
||||||
variables.build_path = "{{ 'BUILD_PATH' | env('./build') }}"
|
variables.build_path = "{{ 'BUILD_PATH' | env('./build') }}"
|
||||||
variables.target_path = "{{ 'TARGET_PATH' | env('./target') }}"
|
variables.target_path = "{{ 'TARGET_PATH' | env('./target') }}"
|
||||||
commands = [
|
commands = [
|
||||||
"mkdir -p \"{{ sdk_path }}\" \"{{ build_path }}\" \"{{ target_path }}\" \"src-gen\"",
|
"mkdir -p \"{{ sdk_path }}\" \"{{ publish_path }}\" \"{{ build_path }}\" \"{{ target_path }}\" \"src-gen\"",
|
||||||
"PROJECT={{ project_name }} SDK_PATH={{ sdk_path }} BUILD_PATH={{ build_path }} TARGET_PATH={{ target_path }} docker compose run --rm --user $(id -u):$(id -g) --build --remove-orphans builder",
|
"PROJECT={{ project_name }} SDK_PATH={{ sdk_path }} BUILD_PATH={{ build_path }} TARGET_PATH={{ target_path }} PUBLISH_PATH={{ publish_path }} docker compose run --rm --user $(id -u):$(id -g) --build --remove-orphans builder",
|
||||||
]
|
]
|
||||||
|
|
||||||
[presets.gitea]
|
[presets.gitea]
|
||||||
|
|||||||
+7
-6
@@ -1,8 +1,8 @@
|
|||||||
FROM ubuntu:resolute AS base
|
FROM ubuntu:noble AS base
|
||||||
RUN apt update && apt install -y \
|
RUN apt update && apt install -y \
|
||||||
nodejs \
|
nodejs \
|
||||||
npm \
|
npm \
|
||||||
openjdk-17-jre \
|
openjdk-11-jre \
|
||||||
protobuf-compiler \
|
protobuf-compiler \
|
||||||
jq
|
jq
|
||||||
RUN node -v
|
RUN node -v
|
||||||
@@ -14,18 +14,19 @@ WORKDIR /app
|
|||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN --mount=type=cache,target=/root/.npm \
|
RUN --mount=type=cache,target=/root/.npm \
|
||||||
npm ci
|
npm ci
|
||||||
COPY haxetool.json protohx.json ./
|
COPY gulpfile.js protohx.json ./
|
||||||
|
COPY tasks ./tasks
|
||||||
COPY config.example.json ./config.example.json
|
COPY config.example.json ./config.example.json
|
||||||
RUN --mount=type=secret,id=KEY_STORE \
|
RUN --mount=type=secret,id=KEY_STORE \
|
||||||
cat /run/secrets/KEY_STORE > ./key.jks
|
cat /run/secrets/KEY_STORE > ./key.jks
|
||||||
RUN --mount=type=secret,id=KEY_PASS \
|
RUN --mount=type=secret,id=KEY_PASS \
|
||||||
jq --arg key_pass "$(cat /run/secrets/KEY_PASS)" \
|
jq --arg key_pass "$(cat /run/secrets/KEY_PASS)" \
|
||||||
'.SdkDir = "/sdk" | .Key.store = "key.jks" | .Key.pass = $key_pass' \
|
'.SdkDir = "/sdk" | .PublishDir = "/app/publish" | .Key.store = "key.jks" | .Key.pass = $key_pass' \
|
||||||
config.example.json > config.json
|
config.example.json > config.json
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY dependencies ./dependencies
|
COPY dependencies ./dependencies
|
||||||
VOLUME ["/sdk", "/app/build", "/app/target", "/app/src-gen"]
|
VOLUME ["/sdk", "/app/build", "/app/target", "/app/publish", "/app/src-gen"]
|
||||||
CMD ["npm", "run", "build"]
|
CMD ["npx", "gulp", "default"]
|
||||||
|
|
||||||
FROM hello-world AS web
|
FROM hello-world AS web
|
||||||
ARG PROJECT_NAME
|
ARG PROJECT_NAME
|
||||||
|
|||||||
+5
-1
@@ -1,5 +1,9 @@
|
|||||||
{
|
{
|
||||||
"UseRuffle": true,
|
"SdkDir": "$HOME/sdk",
|
||||||
|
"BuildDir": null,
|
||||||
|
"PublishDir": "$HOME/public/puzzlez",
|
||||||
|
"PublishUrl": "https://shmyga.ru/repo/puzzlez",
|
||||||
|
"Develop": false,
|
||||||
"Key": {
|
"Key": {
|
||||||
"store": "keystore.jks",
|
"store": "keystore.jks",
|
||||||
"pass": null
|
"pass": null
|
||||||
|
|||||||
Vendored
+2
-1
@@ -1,2 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ru.m.android" />
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ru.m.android">
|
||||||
|
</manifest>
|
||||||
Vendored
-22
@@ -1,22 +0,0 @@
|
|||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
google()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath 'com.android.tools.build:gradle:::ANDROID_GRADLE_PLUGIN::'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'com.android.library'
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace "ru.m.android"
|
|
||||||
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
|
|
||||||
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation project(':deps:extension-api')
|
|
||||||
}
|
|
||||||
Vendored
+11
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project name="android" default="help">
|
||||||
|
<property environment="env" />
|
||||||
|
<property name="sdk.dir" value="${env.ANDROID_SDK}" />
|
||||||
|
|
||||||
|
<property file="local.properties" />
|
||||||
|
<property file="ant.properties" />
|
||||||
|
<property file="project.properties" />
|
||||||
|
|
||||||
|
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||||
|
</project>
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
android.library=true
|
||||||
|
android.library.reference.1=../extension-api
|
||||||
|
target=android-::ANDROID_TARGET_SDK_VERSION::
|
||||||
@@ -13,6 +13,7 @@ services:
|
|||||||
- ${SDK_PATH}:/sdk
|
- ${SDK_PATH}:/sdk
|
||||||
- ${BUILD_PATH}:/app/build
|
- ${BUILD_PATH}:/app/build
|
||||||
- ${TARGET_PATH}:/app/target
|
- ${TARGET_PATH}:/app/target
|
||||||
|
- ${PUBLISH_PATH}:/app/publish
|
||||||
- ./src-gen:/app/src-gen
|
- ./src-gen:/app/src-gen
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
|
|||||||
+142
@@ -0,0 +1,142 @@
|
|||||||
|
const gulp = require("gulp");
|
||||||
|
const gulpClean = require("gulp-clean");
|
||||||
|
const Config = require("./config.json");
|
||||||
|
const packageInfo = require("./package.json");
|
||||||
|
const { System, Sdk, Haxe, Project } = require("gulp-haxetool");
|
||||||
|
const dateformat = require("dateformat");
|
||||||
|
const publish = require("./tasks/gulp-publish");
|
||||||
|
const os = require("os");
|
||||||
|
|
||||||
|
const resolvePath = (path) => path.replace("$HOME", os.homedir());
|
||||||
|
|
||||||
|
if (packageInfo.haxe) {
|
||||||
|
Haxe.VERSION = packageInfo.haxe;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config.SdkDir) {
|
||||||
|
Sdk.dir = resolvePath(Config.SdkDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config.BuildDir) {
|
||||||
|
Haxe.buildDir = resolvePath(Config.BuildDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.clean = function clean() {
|
||||||
|
return gulp.src("target/*", { read: false }).pipe(gulpClean());
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.setup = function setup() {
|
||||||
|
const builder = Project.Builder.new(
|
||||||
|
app.config,
|
||||||
|
Project.Platform.ANDROID,
|
||||||
|
app.buildSystem,
|
||||||
|
);
|
||||||
|
return builder.prepare();
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.generate = function generate() {
|
||||||
|
return exports.setup().then(() =>
|
||||||
|
new Haxe()
|
||||||
|
.haxelib(["run", "protohx", "generate", "protohx.json"])
|
||||||
|
.then(({ stdout }) => {
|
||||||
|
if (stdout.indexOf("FAIL") > -1) {
|
||||||
|
throw stdout;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const config = new Project.Config({
|
||||||
|
meta: {
|
||||||
|
title: "Puzzle'z",
|
||||||
|
filename: "puzzlez",
|
||||||
|
icon: "src/app/resources/icon.png",
|
||||||
|
pack: "ru.m.puzzlez",
|
||||||
|
author: "shmyga <shmyga.z@gmail.com>",
|
||||||
|
company: "MegaLoMania",
|
||||||
|
version: packageInfo.version + (Config.Develop ? "-SNAPSHOT" : ""),
|
||||||
|
},
|
||||||
|
key: Config.Key,
|
||||||
|
libs: packageInfo.haxeDependencies,
|
||||||
|
macros: [
|
||||||
|
`CompilationOption.set('build','${dateformat(new Date(), "yyyy-mm-dd HH:MM:ss")}')`,
|
||||||
|
`CompilationOption.set('UNSPLASH_KEY','${Config.UnsplashKey}')`,
|
||||||
|
`CompilationOption.set('PIXABAY_KEY','${Config.PixabayKey}')`,
|
||||||
|
],
|
||||||
|
flags: ["proto_debug"],
|
||||||
|
});
|
||||||
|
|
||||||
|
const app = new Project(
|
||||||
|
Project.BuildSystem.OPENFL,
|
||||||
|
[
|
||||||
|
Project.Platform.FLASH,
|
||||||
|
Project.Platform.HTML5,
|
||||||
|
Project.Platform.LINUX,
|
||||||
|
Project.Platform.WINDOWS,
|
||||||
|
Project.Platform.ANDROID,
|
||||||
|
],
|
||||||
|
config.branch({
|
||||||
|
name: "app",
|
||||||
|
sources: ["src-gen/haxe", "src/common/haxe", "src/app/haxe"],
|
||||||
|
android: [
|
||||||
|
{
|
||||||
|
path: "dependencies/android",
|
||||||
|
extensions: ["ru.m.android.FileUtil"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
assets: ["src/app/resources"],
|
||||||
|
main: "ru.m.puzzlez.PuzzlezApp",
|
||||||
|
meta: {
|
||||||
|
width: 1280,
|
||||||
|
height: 768,
|
||||||
|
},
|
||||||
|
flags: ["app"],
|
||||||
|
}),
|
||||||
|
).bind(module, gulp);
|
||||||
|
|
||||||
|
const server = new Project(
|
||||||
|
Project.BuildSystem.HAXE,
|
||||||
|
[Project.Platform.NEKO, Project.Platform.CPP],
|
||||||
|
config.branch({
|
||||||
|
name: "server",
|
||||||
|
sources: ["src-gen/haxe", "src/common/haxe", "src/server/haxe"],
|
||||||
|
main: "ru.m.puzzlez.PuzzlezServer",
|
||||||
|
}),
|
||||||
|
).bind(module, gulp);
|
||||||
|
|
||||||
|
module.exports.publish = publish(
|
||||||
|
packageInfo.name,
|
||||||
|
packageInfo.version,
|
||||||
|
resolvePath(Config.PublishDir),
|
||||||
|
Config.PublishUrl,
|
||||||
|
);
|
||||||
|
|
||||||
|
const defaultSeries = [
|
||||||
|
exports.clean,
|
||||||
|
exports.generate,
|
||||||
|
module.exports["app:flash:build"],
|
||||||
|
module.exports["app:flash:html"],
|
||||||
|
module.exports["app:html5:build"],
|
||||||
|
];
|
||||||
|
|
||||||
|
if (System.isLinux) {
|
||||||
|
defaultSeries.push(
|
||||||
|
module.exports["app:linux:build"],
|
||||||
|
module.exports["app:linux:archive"],
|
||||||
|
module.exports["app:linux:deb"],
|
||||||
|
|
||||||
|
module.exports["app:android:build"],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (System.isWindows) {
|
||||||
|
defaultSeries.push(
|
||||||
|
module.exports["app:windows:build"],
|
||||||
|
module.exports["app:windows:archive"],
|
||||||
|
module.exports["app:windows:installer"],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultSeries.push(exports.publish);
|
||||||
|
|
||||||
|
module.exports.default = gulp.series(defaultSeries);
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
{
|
|
||||||
"default": {
|
|
||||||
"meta": {
|
|
||||||
"title": "Puzzle'z",
|
|
||||||
"filename": "puzzlez",
|
|
||||||
"icon": "src/app/resources/icon.png",
|
|
||||||
"pack": "ru.m.puzzlez",
|
|
||||||
"author": "shmyga <shmyga.z@gmail.com>",
|
|
||||||
"company": "MegaLoMania",
|
|
||||||
"version": "<%=package.version%>"
|
|
||||||
},
|
|
||||||
"sources": ["src-gen/haxe", "src/common/haxe"],
|
|
||||||
"libs": {
|
|
||||||
"haxework": "2.1.0",
|
|
||||||
"lime": "8.3.2",
|
|
||||||
"openfl": "9.5.2",
|
|
||||||
"hxcpp": "4.2.1",
|
|
||||||
"svg": "1.1.3",
|
|
||||||
"protohx": "0.4.6",
|
|
||||||
"yield": "3.2.2",
|
|
||||||
"formatter": "1.16.0"
|
|
||||||
},
|
|
||||||
"key": {
|
|
||||||
"store": "<%=config.Key.store%>",
|
|
||||||
"pass": "<%=config.Key.pass%>"
|
|
||||||
},
|
|
||||||
"macros": [
|
|
||||||
"CompilationOption.set('build','<%=dateformat(Date.now(), 'yyyy-mm-dd HH:MM:ss')%>')",
|
|
||||||
"CompilationOption.set('UNSPLASH_KEY','<%=config.UnsplashKey%>')",
|
|
||||||
"CompilationOption.set('PIXABAY_KEY','<%=config.PixabayKey%>')"
|
|
||||||
],
|
|
||||||
"flags": ["proto_debug"]
|
|
||||||
},
|
|
||||||
"app": {
|
|
||||||
"buildSystem": "openfl",
|
|
||||||
"platforms": ["flash", "html5", "linux", "windows", "android"],
|
|
||||||
"sources": ["src/app/haxe"],
|
|
||||||
"android": [
|
|
||||||
{
|
|
||||||
"path": "dependencies/android",
|
|
||||||
"extensions": ["ru.m.android.FileUtil"]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"assets": ["src/app/resources"],
|
|
||||||
"main": "ru.m.puzzlez.PuzzlezApp",
|
|
||||||
"meta": {
|
|
||||||
"width": 1280,
|
|
||||||
"height": 768
|
|
||||||
},
|
|
||||||
"macros": [
|
|
||||||
"CompilationOption.set('host','<%=env.HOST || '0.0.0.0'%>')",
|
|
||||||
"CompilationOption.set('port',<%=env.PORT || '5000'%>)"
|
|
||||||
],
|
|
||||||
"flags": ["app"]
|
|
||||||
},
|
|
||||||
"server": {
|
|
||||||
"buildSystem": "haxe",
|
|
||||||
"platforms": ["cpp"],
|
|
||||||
"sources": ["src/server/haxe"],
|
|
||||||
"main": "ru.m.puzzlez.PuzzlezServer"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"excludes": ["src-gen"],
|
|
||||||
"indentation": {
|
"indentation": {
|
||||||
"character": " "
|
"character": " "
|
||||||
},
|
},
|
||||||
|
|||||||
Generated
+11542
-3600
File diff suppressed because it is too large
Load Diff
+23
-8
@@ -1,14 +1,29 @@
|
|||||||
{
|
{
|
||||||
"name": "puzzlez",
|
"name": "puzzlez",
|
||||||
"type": "module",
|
"version": "0.6.1",
|
||||||
"version": "0.6.2",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "hxt default",
|
"build": "gulp",
|
||||||
"dev": "hxt app:flash:test",
|
"dev": "gulp app:flash:test"
|
||||||
"lint": "hxt check --verbose",
|
|
||||||
"format": "hxt format"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp-haxetool": "^2.1.0"
|
"dateformat": "^3.0.3",
|
||||||
}
|
"fs-extra": "^10.1.0",
|
||||||
|
"gulp": "^4.0.0",
|
||||||
|
"gulp-add": "0.0.2",
|
||||||
|
"gulp-clean": "^0.4.0",
|
||||||
|
"gulp-cli": "^2.2.0",
|
||||||
|
"gulp-haxetool": "^0.2.2",
|
||||||
|
"yargs": "^13.2.4"
|
||||||
|
},
|
||||||
|
"haxeDependencies": {
|
||||||
|
"haxework": "2.1.0",
|
||||||
|
"lime": "8.0.0",
|
||||||
|
"openfl": "9.2.0",
|
||||||
|
"hxcpp": "4.2.1",
|
||||||
|
"svg": "1.1.3",
|
||||||
|
"protohx": "0.4.6",
|
||||||
|
"yield": "3.2.2",
|
||||||
|
"formatter": "1.16.0"
|
||||||
|
},
|
||||||
|
"haxe": "4.2.5"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
{
|
{
|
||||||
"args": ["${input:target}"],
|
"args": ["${input:target}"],
|
||||||
"name": "${input:target}",
|
"name": "${input:target}",
|
||||||
"program": "${workspaceFolder}/node_modules/.bin/hxt",
|
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"skipFiles": ["<node_internals>/**"],
|
"skipFiles": ["<node_internals>/**"],
|
||||||
"type": "node",
|
"type": "node",
|
||||||
|
|||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
cd "$(dirname $(dirname "$0"))" || exit
|
||||||
|
source .env
|
||||||
|
|
||||||
|
mkdir -p "$SDK_PATH" "$PUBLISH_PATH" "$BUILD_PATH" "$TARGET_PATH" "src-gen"
|
||||||
|
docker compose run --rm --user $(id -u):$(id -g) --build --remove-orphans builder
|
||||||
|
|
||||||
|
./scripts/docker-action
|
||||||
Executable
+45
@@ -0,0 +1,45 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
cd "$(dirname $(dirname "$0"))" || exit
|
||||||
|
|
||||||
|
. .env
|
||||||
|
|
||||||
|
build () {
|
||||||
|
echo "build: $1"
|
||||||
|
. "$1/.env"
|
||||||
|
for PROJECT in "${DOCKER_PROJECTS[@]}"; do
|
||||||
|
IFS=: read -r PROJECT_NAME PROJECT_TARGET <<< "$PROJECT"
|
||||||
|
ARGS=("build")
|
||||||
|
for ARG in ${DOCKER_ARGS[@]}; do
|
||||||
|
ARGS+=("--build-arg" "$ARG")
|
||||||
|
done
|
||||||
|
if [ -n "$PROJECT_TARGET" ]; then
|
||||||
|
ARGS+=("--target" "$PROJECT_TARGET")
|
||||||
|
fi
|
||||||
|
ARGS+=("-t" "$DOCKER_GROUP/$PROJECT_NAME" ".")
|
||||||
|
ARGS+=("-f" "$1/Dockerfile")
|
||||||
|
echo "${ARGS[@]}"
|
||||||
|
docker "${ARGS[@]}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
publish () {
|
||||||
|
echo "publish: $1"
|
||||||
|
. "$1/.env"
|
||||||
|
for PROJECT in "${DOCKER_PROJECTS[@]}"; do
|
||||||
|
IFS=: read -r PROJECT_NAME PROJECT_TARGET <<< "$PROJECT"
|
||||||
|
docker tag $DOCKER_GROUP/$PROJECT_NAME $DOCKER_ROOT/$PROJECT_NAME:$VERSION
|
||||||
|
docker tag $DOCKER_GROUP/$PROJECT_NAME $DOCKER_ROOT/$PROJECT_NAME:latest
|
||||||
|
docker push $DOCKER_ROOT/$PROJECT_NAME:$VERSION
|
||||||
|
docker push $DOCKER_ROOT/$PROJECT_NAME:latest
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFAULT_TARGETS="."
|
||||||
|
TARGETS="${@-$DEFAULT_TARGETS}"
|
||||||
|
|
||||||
|
DOCKER_ACTION="${DOCKER_ACTION-build}"
|
||||||
|
|
||||||
|
for TARGET in $TARGETS; do
|
||||||
|
$DOCKER_ACTION "$TARGET"
|
||||||
|
done
|
||||||
Executable
+35
@@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
cd "$(dirname $(dirname "$0"))" || exit
|
||||||
|
source .env
|
||||||
|
|
||||||
|
PACKAGES=(
|
||||||
|
"android/${PROJECT}_${VERSION}.apk"
|
||||||
|
"debian/${PROJECT}_${VERSION}_all.deb"
|
||||||
|
"archive/${PROJECT}_${VERSION}_linux.tar.gz"
|
||||||
|
"archive/${PROJECT}_${VERSION}_win.zip"
|
||||||
|
"installer/${PROJECT}_${VERSION}.exe"
|
||||||
|
)
|
||||||
|
|
||||||
|
for PACKAGE in "${PACKAGES[@]}"
|
||||||
|
do
|
||||||
|
if [ -f "${PUBLISH_PATH}/${PACKAGE}" ]; then
|
||||||
|
PACKAGE_NAME=$(basename "$PACKAGE")
|
||||||
|
echo "publish: $PACKAGE"
|
||||||
|
curl --user "${PUBLISH_USER}:${PUBLISH_PASSWORD}" -X DELETE \
|
||||||
|
"${REPO}/generic/${PROJECT}/${VERSION}/${PACKAGE_NAME}"
|
||||||
|
curl --user "${PUBLISH_USER}:${PUBLISH_PASSWORD}" \
|
||||||
|
--upload-file "${PUBLISH_PATH}/${PACKAGE}" \
|
||||||
|
"${REPO}/generic/${PROJECT}/${VERSION}/${PACKAGE_NAME}"
|
||||||
|
|
||||||
|
if [[ "$PACKAGE" == *.deb ]]; then
|
||||||
|
curl --user "${PUBLISH_USER}:${PUBLISH_PASSWORD}" -X DELETE \
|
||||||
|
"${REPO}/debian/pool/noble/main/${PROJECT}/${VERSION}/all"
|
||||||
|
curl --user "${PUBLISH_USER}:${PUBLISH_PASSWORD}" \
|
||||||
|
--upload-file "${PUBLISH_PATH}/${PACKAGE}" \
|
||||||
|
"${REPO}/debian/pool/noble/main/upload"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
DOCKER_ACTION=publish ./scripts/docker-action
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
cd "$(dirname $(dirname "$0"))" || exit
|
||||||
|
|
||||||
|
npm ci
|
||||||
@@ -25,7 +25,6 @@ class NginxImageSource implements ImageSource {
|
|||||||
public var id(default, never):String = "nginx";
|
public var id(default, never):String = "nginx";
|
||||||
|
|
||||||
private var baseUrl:String;
|
private var baseUrl:String;
|
||||||
private var cache:Map<String, Promise<NginxResponse>> = new Map();
|
|
||||||
|
|
||||||
public function new(baseUrl:String) {
|
public function new(baseUrl:String) {
|
||||||
this.baseUrl = baseUrl;
|
this.baseUrl = baseUrl;
|
||||||
@@ -37,11 +36,8 @@ class NginxImageSource implements ImageSource {
|
|||||||
|
|
||||||
public function getPage(page:Page):Promise<DataPage<ImageId>> {
|
public function getPage(page:Page):Promise<DataPage<ImageId>> {
|
||||||
var category = page.filter.get("category");
|
var category = page.filter.get("category");
|
||||||
var url = category != null ? this.baseUrl + category + "/" : this.baseUrl;
|
return new JsonLoader<NginxResponse>().GET(category != null ? this.baseUrl + category + "/" : this.baseUrl)
|
||||||
if (!this.cache.exists(url)) {
|
.then((response:NginxResponse) -> {
|
||||||
this.cache.set(url, new JsonLoader<NginxResponse>().GET(url));
|
|
||||||
}
|
|
||||||
return this.cache.get(url).then((response:NginxResponse) -> {
|
|
||||||
var data:Array<ImageId> = [];
|
var data:Array<ImageId> = [];
|
||||||
for (item in response) {
|
for (item in response) {
|
||||||
if (item.type == NginxResponseItemType.FILE) {
|
if (item.type == NginxResponseItemType.FILE) {
|
||||||
@@ -49,7 +45,6 @@ class NginxImageSource implements ImageSource {
|
|||||||
data.push(new ImageId().setSource(id).setId(itemId));
|
data.push(new ImageId().setSource(id).setId(itemId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data = data.slice(page.index * page.count, (page.index + 1) * page.count);
|
|
||||||
return {
|
return {
|
||||||
page: page,
|
page: page,
|
||||||
data: data,
|
data: data,
|
||||||
@@ -60,12 +55,12 @@ class NginxImageSource implements ImageSource {
|
|||||||
|
|
||||||
public function load(id:String, thumb:Bool = false):Promise<ImageValue> {
|
public function load(id:String, thumb:Bool = false):Promise<ImageValue> {
|
||||||
var url = this.baseUrl + StringTools.replace(id, "@", "/");
|
var url = this.baseUrl + StringTools.replace(id, "@", "/");
|
||||||
// TODO: default size by screen width?
|
if (thumb) {
|
||||||
var width = thumb ? 360 : 1920;
|
|
||||||
var parts = url.split(".");
|
var parts = url.split(".");
|
||||||
var index = parts.length - 2;
|
var index = parts.length - 2;
|
||||||
parts[index] = parts[index] + '-w${width}';
|
parts[index] = parts[index] + "-thumbnail";
|
||||||
url = parts.join(".");
|
url = parts.join(".");
|
||||||
|
}
|
||||||
return Promise.promise(ImageValue.URL(url));
|
return Promise.promise(ImageValue.URL(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,23 @@ import ru.m.puzzlez.render.Background;
|
|||||||
|
|
||||||
@:singleton @:template class BackgroundPopup extends PopupView<Background> {
|
@:singleton @:template class BackgroundPopup extends PopupView<Background> {
|
||||||
private static var colorsList:Array<Color> = [
|
private static var colorsList:Array<Color> = [
|
||||||
'#FFFFFF', '#001f3f', '#0074D9', '#7FDBFF', '#39CCCC', '#3D9970', '#2ECC40', '#01FF70', '#FFDC00', '#FF851B',
|
'#FFFFFF',
|
||||||
'#FF4136', '#85144b', '#F012BE', '#B10DC9', '#111111', '#AAAAAA', '#DDDDDD',
|
'#001f3f',
|
||||||
|
'#0074D9',
|
||||||
|
'#7FDBFF',
|
||||||
|
'#39CCCC',
|
||||||
|
'#3D9970',
|
||||||
|
'#2ECC40',
|
||||||
|
'#01FF70',
|
||||||
|
'#FFDC00',
|
||||||
|
'#FF851B',
|
||||||
|
'#FF4136',
|
||||||
|
'#85144b',
|
||||||
|
'#F012BE',
|
||||||
|
'#B10DC9',
|
||||||
|
'#111111',
|
||||||
|
'#AAAAAA',
|
||||||
|
'#DDDDDD',
|
||||||
];
|
];
|
||||||
|
|
||||||
@:view("selected") var selectedView:SpriteView;
|
@:view("selected") var selectedView:SpriteView;
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import ru.m.puzzlez.proto.pack.GameListResponse;
|
|||||||
import ru.m.puzzlez.proto.pack.GameListRequest;
|
import ru.m.puzzlez.proto.pack.GameListRequest;
|
||||||
import hw.connect.session.ProtoSession;
|
import hw.connect.session.ProtoSession;
|
||||||
import hw.log.BaseLogger.LoggerUtil;
|
import hw.log.BaseLogger.LoggerUtil;
|
||||||
import ru.m.puzzlez.game.Game;
|
import ru.m.puzzlez.image.Game;
|
||||||
import ru.m.puzzlez.game.GameUtil;
|
import ru.m.puzzlez.image.GameUtil;
|
||||||
import ru.m.puzzlez.proto.core.User;
|
import ru.m.puzzlez.proto.core.User;
|
||||||
import ru.m.puzzlez.proto.event.GameAction;
|
import ru.m.puzzlez.proto.event.GameAction;
|
||||||
import ru.m.puzzlez.proto.event.GameEvent;
|
import ru.m.puzzlez.proto.event.GameEvent;
|
||||||
|
|||||||
Executable
+134
@@ -0,0 +1,134 @@
|
|||||||
|
const gulp = require("gulp");
|
||||||
|
const fs = require("fs");
|
||||||
|
const fse = require("fs-extra");
|
||||||
|
const path = require("path");
|
||||||
|
const through = require("through2");
|
||||||
|
|
||||||
|
class Package {
|
||||||
|
constructor(platform, type, version, versionInt) {
|
||||||
|
this.platform = platform;
|
||||||
|
this.type = type;
|
||||||
|
this.version = version;
|
||||||
|
this.versionInt = versionInt;
|
||||||
|
}
|
||||||
|
|
||||||
|
get key() {
|
||||||
|
return [this.platform, this.type].join(":");
|
||||||
|
}
|
||||||
|
|
||||||
|
static getPlatform(filename) {
|
||||||
|
for (const [platform, r] of [
|
||||||
|
["android", /^.*?\.apk$/],
|
||||||
|
["linux", /^.*?\.deb$/],
|
||||||
|
["linux", /^.*?linux\.tar\.gz$/],
|
||||||
|
["windows", /^.*?win\.zip$/],
|
||||||
|
["windows", /^.*?\.exe$/],
|
||||||
|
]) {
|
||||||
|
if (r.test(filename)) {
|
||||||
|
return platform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static getType(filename) {
|
||||||
|
for (const [type, r] of [
|
||||||
|
["apk", /^.*?\.apk$/],
|
||||||
|
["deb", /^.*?\.deb$/],
|
||||||
|
["archive", /^.*?\.tar\.gz$/],
|
||||||
|
["archive", /^.*?\.zip$/],
|
||||||
|
["exe", /^.*?\.exe$/],
|
||||||
|
]) {
|
||||||
|
if (r.test(filename)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static getVersion(filename) {
|
||||||
|
const m = /(\d+)\.(\d+)\.(\d+)/.exec(filename);
|
||||||
|
if (m) {
|
||||||
|
return [
|
||||||
|
m[0],
|
||||||
|
parseInt(m[1]) * 10000 + parseInt(m[2]) * 100 + parseInt(m[3]),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static parseFilename(filename) {
|
||||||
|
const platform = this.getPlatform(filename);
|
||||||
|
const type = this.getType(filename);
|
||||||
|
const version = this.getVersion(filename);
|
||||||
|
if (platform && type && version) {
|
||||||
|
return new Package(platform, type, version[0], version[1]);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = (name, version, publishDir, publishUrl) =>
|
||||||
|
function publish(cb) {
|
||||||
|
const packages = {};
|
||||||
|
fse.ensureDirSync(publishDir);
|
||||||
|
return gulp.series([
|
||||||
|
function copy() {
|
||||||
|
return gulp
|
||||||
|
.src("target/app/@(android|archive|debian|installer)/*")
|
||||||
|
.pipe(
|
||||||
|
through.obj(function (file, enc, cb) {
|
||||||
|
const pack = Package.parseFilename(file.path);
|
||||||
|
if (pack) {
|
||||||
|
this.push(file);
|
||||||
|
}
|
||||||
|
cb(null);
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.pipe(gulp.dest(publishDir));
|
||||||
|
},
|
||||||
|
function generate() {
|
||||||
|
return gulp
|
||||||
|
.src(`${publishDir}/*/*`)
|
||||||
|
.pipe(
|
||||||
|
through.obj(function (file, enc, cb) {
|
||||||
|
const basepath = file.path.replace(file.base + path.sep, "");
|
||||||
|
const pack = Package.parseFilename(file.path);
|
||||||
|
if (pack) {
|
||||||
|
if (
|
||||||
|
!packages[pack.key] ||
|
||||||
|
packages[pack.key].versionInt < pack.versionInt
|
||||||
|
) {
|
||||||
|
packages[pack.key] = {
|
||||||
|
platform: pack.platform,
|
||||||
|
type: pack.type,
|
||||||
|
version: pack.version,
|
||||||
|
versionInt: pack.versionInt,
|
||||||
|
path: basepath,
|
||||||
|
filename: basepath.split(path.sep).pop(),
|
||||||
|
url: `${publishUrl}/${basepath.replace(path.sep, "/")}`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cb(null);
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.on("end", function () {
|
||||||
|
fs.writeFileSync(
|
||||||
|
path.join(publishDir, "packages.json"),
|
||||||
|
JSON.stringify(
|
||||||
|
{
|
||||||
|
name: name,
|
||||||
|
version: version,
|
||||||
|
packages: Object.values(packages),
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
4
|
||||||
|
)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
])(cb);
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.Package = Package;
|
||||||
Reference in New Issue
Block a user