mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
bump prerelease
This commit is contained in:
15 files changed
+34
-38
No files matched your search
+4
-2
@@ -4,14 +4,14 @@ import { writeFileSync } from 'fs';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import ora from 'ora';
|
import ora from 'ora';
|
||||||
import packageJson from 'package-json';
|
import packageJson from 'package-json';
|
||||||
import { gt } from 'semver';
|
import { gt, prerelease } from 'semver';
|
||||||
import { getWorkspaces, spawnAsync } from './utils';
|
import { getWorkspaces, spawnAsync } from './utils';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
CI, GITHUB_EVENT_NAME, GITHUB_REF,
|
CI, GITHUB_EVENT_NAME, GITHUB_REF,
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
const tag = GITHUB_REF === 'refs/heads/master' ? 'latest' : GITHUB_REF === 'refs/heads/develop' ? 'dev' : undefined;
|
const tag = GITHUB_REF === 'refs/heads/master' ? 'latest' : GITHUB_REF === 'refs/heads/next' ? 'dev' : undefined;
|
||||||
|
|
||||||
if (CI && (!tag || GITHUB_EVENT_NAME !== 'push')) {
|
if (CI && (!tag || GITHUB_EVENT_NAME !== 'push')) {
|
||||||
console.log('publish skipped.');
|
console.log('publish skipped.');
|
||||||
@@ -54,9 +54,11 @@ if (CI && (!tag || GITHUB_EVENT_NAME !== 'push')) {
|
|||||||
console.log(`publishing ${name}@${bumpMap[name]} ...`);
|
console.log(`publishing ${name}@${bumpMap[name]} ...`);
|
||||||
if (tag === 'dev') {
|
if (tag === 'dev') {
|
||||||
const pkg = require(`${name}/package.json`);
|
const pkg = require(`${name}/package.json`);
|
||||||
|
if (!prerelease(pkg.version)) {
|
||||||
pkg.version += '-dev';
|
pkg.version += '-dev';
|
||||||
writeFileSync(path.resolve(`${name}/package.json`), JSON.stringify(pkg));
|
writeFileSync(path.resolve(`${name}/package.json`), JSON.stringify(pkg));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
await spawnAsync(
|
await spawnAsync(
|
||||||
`yarn npm publish --access public --tag ${tag}`,
|
`yarn npm publish --access public --tag ${tag}`,
|
||||||
path.resolve(name),
|
path.resolve(name),
|
||||||
|
|||||||
@@ -82,6 +82,13 @@ async function run({ domainId }, report) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const apply = (ctx: Context) => {
|
export const apply = (ctx: Context) => {
|
||||||
|
ctx.setting.SystemSetting(Schema.object({
|
||||||
|
'elastic-search': Schema.object({
|
||||||
|
url: Schema.string().role('url').default('http://127.0.0.1:9200'),
|
||||||
|
indexSize: Schema.number().role('indexSize').default(10000).min(0).step(1),
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
ctx.on('problem/add', async (doc, docId) => {
|
ctx.on('problem/add', async (doc, docId) => {
|
||||||
await client.index({
|
await client.index({
|
||||||
index: 'problem',
|
index: 'problem',
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/elastic-search",
|
"name": "@hydrooj/elastic-search",
|
||||||
"version": "1.1.8",
|
"version": "1.2.0-alpha.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro",
|
"repository": "https://github.com/hydro-dev/Hydro",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@elastic/elasticsearch": "^8.17.1"
|
"@elastic/elasticsearch": "^8.17.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"hydrooj": ">=5.0.0-alpha.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
url:
|
|
||||||
value: http://127.0.0.1:9200
|
|
||||||
indexSize:
|
|
||||||
value: 10000
|
|
||||||
@@ -36,6 +36,6 @@ export default class GeoIPService extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function apply(ctx: Context) {
|
export function apply(ctx: Context) {
|
||||||
ctx.set('geoip', new GeoIPService(ctx));
|
ctx.plugin(GeoIPService);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "3.4.4",
|
"version": "3.5.0-alpha.0",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "4.19.1",
|
"version": "5.0.0-alpha.0",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/plugin-api",
|
"main": "src/plugin-api",
|
||||||
"module": "src/plugin-api",
|
"module": "src/plugin-api",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/migrate",
|
"name": "@hydrooj/migrate",
|
||||||
"version": "0.4.3",
|
"version": "0.4.4-alpha.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"repository": "git@github.com:hydro-dev/Hydro.git",
|
"repository": "git@github.com:hydro-dev/Hydro.git",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/onsite-toolkit",
|
"name": "@hydrooj/onsite-toolkit",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5-alpha.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-spring/web": "^9.7.5",
|
"@react-spring/web": "^9.7.5",
|
||||||
"react-use": "^17.6.0"
|
"react-use": "^17.6.0"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { hostname } from 'os';
|
import { hostname } from 'os';
|
||||||
import { AggregatorRegistry, Metric } from 'prom-client';
|
import { AggregatorRegistry, Metric } from 'prom-client';
|
||||||
import {
|
import {
|
||||||
Context, Handler, superagent, SystemModel,
|
Context, Handler, Schema, superagent, SystemModel,
|
||||||
} from 'hydrooj';
|
} from 'hydrooj';
|
||||||
import { createRegistry } from './metrics';
|
import { createRegistry } from './metrics';
|
||||||
|
|
||||||
@@ -43,6 +43,14 @@ class MetricsHandler extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function apply(ctx: Context) {
|
export function apply(ctx: Context) {
|
||||||
|
ctx.setting.SystemSetting(Schema.object({
|
||||||
|
'prom-client': Schema.object({
|
||||||
|
name: Schema.string().description('basic auth username while requesting metrics').default('admin'),
|
||||||
|
password: Schema.string().role('password').description('basic auth password while requesting metrics').default('admin'),
|
||||||
|
gateway: Schema.string().role('gateway').description('Leave blank to disable push gateway').default(''),
|
||||||
|
collect_rate: Schema.number().role('collect_rate').default(1).description('Collect rate'),
|
||||||
|
}),
|
||||||
|
}));
|
||||||
if (process.env.HYDRO_CLI) return;
|
if (process.env.HYDRO_CLI) return;
|
||||||
const registry = createRegistry(ctx);
|
const registry = createRegistry(ctx);
|
||||||
ctx.on('metrics', (id, metrics) => { instances[id] = metrics; });
|
ctx.on('metrics', (id, metrics) => { instances[id] = metrics; });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/prom-client",
|
"name": "@hydrooj/prom-client",
|
||||||
"version": "0.1.10",
|
"version": "0.2.0-alpha.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prom-client": "^15.1.3"
|
"prom-client": "^15.1.3"
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
name:
|
|
||||||
type: text
|
|
||||||
name: Auth Username
|
|
||||||
desc: basic auth username while requesting metrics
|
|
||||||
default: admin
|
|
||||||
password:
|
|
||||||
type: password
|
|
||||||
name: Auth Password
|
|
||||||
desc: basic auth password while requesting metrics
|
|
||||||
default: admin
|
|
||||||
collect_rate:
|
|
||||||
type: number
|
|
||||||
name: Collect Rate
|
|
||||||
desc: The collect rate scale (default:1)
|
|
||||||
default: 1
|
|
||||||
gateway:
|
|
||||||
type: text
|
|
||||||
name: Push gateway endpoint
|
|
||||||
desc: Leave blank to disable push gateway
|
|
||||||
default: ""
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/sonic",
|
"name": "@hydrooj/sonic",
|
||||||
"version": "1.3.3",
|
"version": "1.4.0-alpha.0",
|
||||||
"description": "Sonic search service",
|
"description": "Sonic search service",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.57.0",
|
"version": "4.58.0-alpha.0",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/utils",
|
"name": "@hydrooj/utils",
|
||||||
"version": "1.4.33",
|
"version": "1.4.34-alpha.0",
|
||||||
"description": "hydrooj utils",
|
"description": "hydrooj utils",
|
||||||
"main": "lib/utils.ts",
|
"main": "lib/utils.ts",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
Reference in new issue
Block a user