ci(pm): add gitea release workflow
This commit is contained in:
+4
-4
@@ -1,14 +1,14 @@
|
||||
PROJECT=puzzlez
|
||||
VERSION=$(grep -m 1 'version' ./package.json | grep -oP '"version"\s*:\s*"\K\d+\.\d+.\d+')
|
||||
#VERSION=$(grep -m 1 'version' ./package.json | grep -oP '"version"\s*:\s*"\K\d+\.\d+.\d+')
|
||||
SDK_PATH=$HOME/sdk
|
||||
PUBLISH_PATH=$HOME/public/$PROJECT
|
||||
BUILD_PATH=./build
|
||||
TARGET_PATH=./target
|
||||
KEY_STORE=<keystore.jks>
|
||||
KEY_PASS=<passphrase>
|
||||
#KEY_STORE=<keystore.jks>
|
||||
#KEY_PASS=<passphrase>
|
||||
|
||||
# publish
|
||||
REPO=https://git.shmyga.ru/api/packages/InfernalGames
|
||||
PUBLISH_REPO=https://git.shmyga.ru/api/packages/InfernalGames
|
||||
PUBLISH_USER=<username>
|
||||
PUBLISH_PASSWORD=<passphrase>
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
name: release
|
||||
|
||||
on: push
|
||||
|
||||
env:
|
||||
KEY_STORE: keystore.jks
|
||||
KEY_PASS: ${{ secrets.KEY_PASS }}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- run: echo '' > requirements.txt
|
||||
- uses: https://git.shmyga.ru/InfernalGames/project-manager@master
|
||||
- name: Restore haxe cache
|
||||
id: cache-haxe-restore
|
||||
uses: actions/cache/restore@v6
|
||||
with:
|
||||
key: ${{ runner.os }}-haxe
|
||||
path: |
|
||||
$HOME/sdk
|
||||
./build
|
||||
- run: echo "${{ secrets.KEY_STORE }}" | base64 --decode > keystore.jks
|
||||
- run: pm build:docker -vv
|
||||
- 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
|
||||
with:
|
||||
key: ${{ steps.cache-haxe-restore.outputs.cache-primary-key }}
|
||||
path: |
|
||||
$HOME/sdk
|
||||
./build
|
||||
#- run: pm publish:docker -vv
|
||||
#- run: pm publish:gitea -vv
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
/build/
|
||||
build/
|
||||
target/
|
||||
src-gen/
|
||||
out/
|
||||
@@ -10,8 +10,8 @@ out/
|
||||
.idea/
|
||||
.ideaDataSources/
|
||||
config.json
|
||||
/node_modules
|
||||
/log
|
||||
/ansible/*.retry
|
||||
node_modules
|
||||
log
|
||||
ansible/*.retry
|
||||
.npmrc
|
||||
.env
|
||||
@@ -0,0 +1,23 @@
|
||||
modules = ["."]
|
||||
|
||||
[presets.docker]
|
||||
variables.docker_target = "web"
|
||||
variables.docker_name = "{{ project_name }}-web"
|
||||
|
||||
[presets.docker.tasks.build.compose]
|
||||
priority = 1
|
||||
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.target_path = "{{ 'TARGET_PATH' | env('./target') }}"
|
||||
commands = [
|
||||
"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",
|
||||
]
|
||||
|
||||
[presets.gitea]
|
||||
variables.publish_artefacts.debian = "target/app/debian/{{ project_name }}_{{ project_version }}_all.deb"
|
||||
variables.publish_artefacts.android = "target/app/android/{{ project_name }}_{{ project_version }}.apk"
|
||||
variables.publish_artefacts.archive_linux = "target/app/archive/{{ project_name }}_{{ project_version }}_linux.tar.gz"
|
||||
variables.publish_artefacts.archive_win = "target/app/archive/{{ project_name }}_{{ project_version }}_win.zip"
|
||||
variables.publish_artefacts.installer = "target/app/installer/{{ project_name }}_{{ project_version }}.exe"
|
||||
+12
-11
@@ -1,10 +1,10 @@
|
||||
FROM ubuntu:noble AS base
|
||||
RUN apt update && apt install -y \
|
||||
nodejs \
|
||||
npm \
|
||||
openjdk-11-jre \
|
||||
protobuf-compiler \
|
||||
jq
|
||||
nodejs \
|
||||
npm \
|
||||
openjdk-11-jre \
|
||||
protobuf-compiler \
|
||||
jq
|
||||
RUN node -v
|
||||
RUN npm -v
|
||||
|
||||
@@ -12,16 +12,17 @@ FROM base AS builder
|
||||
ENV GRADLE_USER_HOME=/sdk/gradle
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm ci
|
||||
COPY gulpfile.js protohx.json ./
|
||||
COPY tasks ./tasks
|
||||
COPY config.example.json ./config.example.json
|
||||
RUN --mount=type=secret,id=KEY_STORE \
|
||||
cat /run/secrets/KEY_STORE > ./key.jks
|
||||
RUN --mount=type=secret,id=KEY_PASS,env=KEY_PASS \
|
||||
jq --arg key_pass "$KEY_PASS" \
|
||||
'.SdkDir = "/sdk" | .PublishDir = "/app/publish" | .Key.store = "key.jks" | .Key.pass = $key_pass' \
|
||||
config.example.json > config.json
|
||||
cat /run/secrets/KEY_STORE > ./key.jks
|
||||
RUN --mount=type=secret,id=KEY_PASS \
|
||||
jq --arg key_pass "$(cat /run/secrets/KEY_PASS)" \
|
||||
'.SdkDir = "/sdk" | .PublishDir = "/app/publish" | .Key.store = "key.jks" | .Key.pass = $key_pass' \
|
||||
config.example.json > config.json
|
||||
COPY src ./src
|
||||
COPY dependencies ./dependencies
|
||||
VOLUME ["/sdk", "/app/build", "/app/target", "/app/publish", "/app/src-gen"]
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
[defaults]
|
||||
hash_behaviour = merge
|
||||
host_key_checking = False
|
||||
#callback_whitelist = profile_tasks
|
||||
display_skipped_hosts = False
|
||||
stdout_callback = yaml
|
||||
bin_ansible_callbacks = True
|
||||
|
||||
[ssh_connection]
|
||||
pipelining = True
|
||||
ssh_args = -o ForwardAgent=yes
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
- hosts: all
|
||||
vars:
|
||||
ansible_user: "{{ deploy_user }}"
|
||||
roles:
|
||||
- ansible-deploy
|
||||
- build
|
||||
post_tasks:
|
||||
- include_role:
|
||||
name: ansible-deploy
|
||||
tasks_from: complete.yml
|
||||
@@ -1,2 +0,0 @@
|
||||
all:
|
||||
hosts: localhost
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
project_name: puzzlez
|
||||
project_user: holop
|
||||
|
||||
deploy_user: "{{ project_user }}"
|
||||
deploy_project: "{{ project_name }}"
|
||||
deploy_repo_url: "git@bitbucket.org:infernalgames/{{ project_name }}.git"
|
||||
deploy_repo_version: master
|
||||
deploy_npm: yes
|
||||
@@ -1,4 +0,0 @@
|
||||
all:
|
||||
hosts: shmyga.ru
|
||||
vars:
|
||||
config_src: "/home/holop/puzzlez/config.json"
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
- name: ansible-deploy
|
||||
src: git@bitbucket.org:shmyga/ansible-deploy.git
|
||||
version: master
|
||||
scm: git
|
||||
@@ -1,2 +0,0 @@
|
||||
config_src: "{{ deploy_release_dir }}/config.{{ inventory_hostname }}.json"
|
||||
config_dest: "{{ deploy_release_dir }}/config.json"
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
- name: "Copy config"
|
||||
copy:
|
||||
src: "{{ config_src }}"
|
||||
dest: "{{ config_dest }}"
|
||||
remote_src: true
|
||||
|
||||
- name: "Gulp build"
|
||||
command: "{{ deploy_release_dir }}/node_modules/.bin/gulp default"
|
||||
args:
|
||||
chdir: "{{ deploy_release_dir }}"
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"SdkDir": "C:\\sdk",
|
||||
"SdkDir": "$HOME/sdk",
|
||||
"BuildDir": null,
|
||||
"PublishDir": "",
|
||||
"PublishDir": "$HOME/public/puzzlez",
|
||||
"PublishUrl": "https://shmyga.ru/repo/puzzlez",
|
||||
"Develop": false,
|
||||
"Key": {
|
||||
|
||||
+6
-3
@@ -6,6 +6,9 @@ const { System, Sdk, Haxe, Project } = require("gulp-haxetool");
|
||||
const dateformat = require("dateformat");
|
||||
const argv = require("yargs").argv;
|
||||
const publish = require("./tasks/gulp-publish");
|
||||
const os = require("os");
|
||||
|
||||
const resolvePath = (path) => path.replace("$HOME", os.homedir());
|
||||
|
||||
Project.useRuffle();
|
||||
|
||||
@@ -14,11 +17,11 @@ if (packageInfo.haxe) {
|
||||
}
|
||||
|
||||
if (Config.SdkDir) {
|
||||
Sdk.dir = Config.SdkDir;
|
||||
Sdk.dir = resolvePath(Config.SdkDir);
|
||||
}
|
||||
|
||||
if (Config.BuildDir) {
|
||||
Haxe.buildDir = Config.BuildDir;
|
||||
Haxe.buildDir = resolvePath(Config.BuildDir);
|
||||
}
|
||||
|
||||
exports.clean = function clean() {
|
||||
@@ -114,7 +117,7 @@ const server = new Project(
|
||||
module.exports.publish = publish(
|
||||
packageInfo.name,
|
||||
packageInfo.version,
|
||||
Config.PublishDir,
|
||||
resolvePath(Config.PublishDir),
|
||||
Config.PublishUrl,
|
||||
);
|
||||
|
||||
|
||||
Generated
+17
-17
@@ -9,12 +9,12 @@
|
||||
"version": "0.6.1",
|
||||
"devDependencies": {
|
||||
"dateformat": "^3.0.3",
|
||||
"fs-extra": "^10.0.0",
|
||||
"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.1",
|
||||
"gulp-haxetool": "^0.2.2",
|
||||
"yargs": "^13.2.4"
|
||||
}
|
||||
},
|
||||
@@ -2165,10 +2165,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/fs-extra": {
|
||||
"version": "10.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
|
||||
"integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
@@ -3495,9 +3496,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/gulp-haxetool": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/gulp-haxetool/-/gulp-haxetool-0.2.1.tgz",
|
||||
"integrity": "sha512-+p38E66G67AxYY1V8ZHRGlNG08EnfdEJezteKhocjBFjnGIguJrwFc0paGvL/zlyWJV1vSyfiLWN8J5HYZLjYg==",
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/gulp-haxetool/-/gulp-haxetool-0.2.2.tgz",
|
||||
"integrity": "sha512-ibrvHeSs3ceTdCFvog+p3sy7o0etsdIzevqQOVmaSW+GB+hyZCPV06/0THot2HPRlX60bRSGr1Nr2bBIIF/4zg==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
@@ -5820,9 +5821,8 @@
|
||||
"node_modules/promise-streams": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/promise-streams/-/promise-streams-2.1.1.tgz",
|
||||
"integrity": "sha512-C8VcyEeT4OIZ6/uUdXLokTpPn0Ea2jf3Vm0o+s4xlY+9LA24Ewxf3oN8bflFfXFlMvs40ptb9+R8pYWcDd695w==",
|
||||
"integrity": "sha1-cwnx02mDMOp/rasZIvE5iSKayFo=",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bluebird": "^2.10.2"
|
||||
},
|
||||
@@ -9313,9 +9313,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "10.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
|
||||
"integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
@@ -10399,9 +10399,9 @@
|
||||
}
|
||||
},
|
||||
"gulp-haxetool": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/gulp-haxetool/-/gulp-haxetool-0.2.1.tgz",
|
||||
"integrity": "sha512-+p38E66G67AxYY1V8ZHRGlNG08EnfdEJezteKhocjBFjnGIguJrwFc0paGvL/zlyWJV1vSyfiLWN8J5HYZLjYg==",
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/gulp-haxetool/-/gulp-haxetool-0.2.2.tgz",
|
||||
"integrity": "sha512-ibrvHeSs3ceTdCFvog+p3sy7o0etsdIzevqQOVmaSW+GB+hyZCPV06/0THot2HPRlX60bRSGr1Nr2bBIIF/4zg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-colors": "^1.1.0",
|
||||
@@ -12316,7 +12316,7 @@
|
||||
"promise-streams": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/promise-streams/-/promise-streams-2.1.1.tgz",
|
||||
"integrity": "sha512-C8VcyEeT4OIZ6/uUdXLokTpPn0Ea2jf3Vm0o+s4xlY+9LA24Ewxf3oN8bflFfXFlMvs40ptb9+R8pYWcDd695w==",
|
||||
"integrity": "sha1-cwnx02mDMOp/rasZIvE5iSKayFo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bluebird": "^2.10.2"
|
||||
|
||||
+6
-3
@@ -1,15 +1,18 @@
|
||||
{
|
||||
"name": "puzzlez",
|
||||
"version": "0.6.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "gulp",
|
||||
"dev": "gulp app:flash:test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"dateformat": "^3.0.3",
|
||||
"fs-extra": "^10.0.0",
|
||||
"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.1",
|
||||
"gulp-haxetool": "^0.2.2",
|
||||
"yargs": "^13.2.4"
|
||||
},
|
||||
"haxeDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user