Update to 2.5.1

Co-authored-by: Louis Lam <louislam@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-08-22 14:30:53 +08:00
1 parent 426d43f53a
commit ee10803f21
14 files changed
+93 -80

No files matched your search

@@ -36,6 +36,13 @@ jobs:
return;
}
// Skip release PRs (created by the release workflow)
const isReleasePR = (pr?.head?.ref || "").startsWith("release-");
if (isReleasePR) {
core.info(`PR #${pr.number} is a release PR, skipping template check.`);
return;
}
const owner = context.repo.owner;
const repo = context.repo.repo;
const number = pr.number;
+16 -11
View File
@@ -22,7 +22,9 @@ on:
type: boolean
default: false
permissions: {}
permissions:
contents: write
pull-requests: write
concurrency:
group: release-${{ inputs.is_beta }}-${{ inputs.version }}
@@ -35,13 +37,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: master
persist-credentials: true
fetch-depth: 0 # Fetch all history and tags for update-version
@@ -52,14 +50,14 @@ jobs:
- name: Configure Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git"
- name: Install dependencies
run: npm clean-install --no-fund
run: node extra/release/install-deps.mjs
- name: Prepare release branch and PR
env:
@@ -67,7 +65,7 @@ jobs:
RELEASE_IS_BETA: ${{ inputs.is_beta }}
RELEASE_PREVIOUS_VERSION: ${{ inputs.previous_version }}
DRY_RUN: ${{ inputs.dry_run }}
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
GH_TOKEN: ${{ github.token }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: node extra/release/prepare-release.mjs --setup-branch
@@ -86,11 +84,18 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: 24
- name: Install dependencies
run: node extra/release/install-deps.mjs
- name: Merge release PR
env:
RELEASE_VERSION: ${{ inputs.version }}
@@ -118,7 +123,6 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: master
persist-credentials: false
fetch-depth: 0 # Fetch all history and tags for changelog generation
@@ -130,6 +134,9 @@ jobs:
- name: Install opencode
run: curl -fsSL https://opencode.ai/install | bash
- name: Install dependencies
run: node extra/release/install-deps.mjs
- name: Create draft release
env:
RELEASE_VERSION: ${{ inputs.version }}
@@ -151,7 +158,6 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: master
persist-credentials: false
- name: Set up Node.js
@@ -198,7 +204,6 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: master
persist-credentials: false
- name: Set up Node.js
-3
View File
@@ -1,10 +1,7 @@
const pkg = require("../package.json");
const fs = require("fs");
const util = require("../src/util");
const dayjs = require("dayjs");
util.polyfill();
const oldVersion = pkg.version;
const newVersion = oldVersion + "-nightly-" + dayjs().format("YYYYMMDDHHmmss");
+1 -1
View File
@@ -12,7 +12,7 @@ import {
isBetaRelease,
readMergeSha,
} from "./lib.mjs";
import { generateChangelogAI } from "../generate-changelog.mjs";
import { generateChangelogAI } from "./generate-changelog.mjs";
/**
* Run the draft release stage
+1 -1
View File
@@ -1,5 +1,5 @@
import { createDraftRelease, getVersionFromEnv, isBetaRelease } from "./lib.mjs";
import { generateChangelogAI } from "../generate-changelog.mjs";
import { generateChangelogAI } from "./generate-changelog.mjs";
const version = getVersionFromEnv();
const previousVersion = process.env.RELEASE_PREVIOUS_VERSION;
@@ -1,5 +1,5 @@
// Script to generate changelog
// Usage: node generate-changelog.mjs <previous-version-tag>
// Usage: node extra/release/generate-changelog.mjs <previous-version-tag>
// GitHub CLI (gh command) is required
import * as childProcess from "child_process";
+46
View File
@@ -0,0 +1,46 @@
// Install only the npm packages needed by the release scripts, skipping the
// full project dependency tree (which is slow). Temporarily empties the
// dependency lists of package.json and removes package-lock.json so `npm install`
// only fetches dotenv/semver/tar, then restores both files before the release
// scripts run (they commit package.json, so the originals must be intact).
//
// Usage: node extra/release/install-deps.mjs
import * as childProcess from "child_process";
import fs from "fs";
const pkgBackup = "package.json.bak";
const lockBackup = "package-lock.json.bak";
// Back up the original files
fs.copyFileSync("package.json", pkgBackup);
const hadLock = fs.existsSync("package-lock.json");
if (hadLock) {
fs.copyFileSync("package-lock.json", lockBackup);
}
// Strip deps so npm install only fetches the packages below
const rootPkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
rootPkg.dependencies = {};
rootPkg.devDependencies = {};
fs.writeFileSync("package.json", JSON.stringify(rootPkg, null, 4) + "\n");
fs.rmSync("package-lock.json", { force: true });
const npm = process.platform === "win32" ? "npm.cmd" : "npm";
const result = childProcess.spawnSync(
npm,
["install", "--no-save", "--no-fund", "dotenv@~16.0.3", "semver@~7.5.4", "tar@~6.2.1"],
{ stdio: "inherit" }
);
// Restore the original files before the release scripts run
fs.copyFileSync(pkgBackup, "package.json");
fs.rmSync(pkgBackup, { force: true });
if (hadLock) {
fs.copyFileSync(lockBackup, "package-lock.json");
fs.rmSync(lockBackup, { force: true });
}
if (result.status !== 0) {
process.exit(result.status ?? 1);
}
+10 -17
View File
@@ -399,7 +399,12 @@ export function buildAllImages(repoNames, version, isBeta) {
buildImage(repoNames, ["beta-rootless", ver(version, "rootless")], "rootless");
// Build slim image
buildImage(repoNames, ["beta-slim", ver(version, "slim")], "release", "BASE_IMAGE=louislam/uptime-kuma:base2-slim");
buildImage(
repoNames,
["beta-slim", ver(version, "slim")],
"release",
"BASE_IMAGE=louislam/uptime-kuma:base2-slim"
);
// Build full image
buildImage(repoNames, ["beta", version], "release");
@@ -570,7 +575,7 @@ export async function createDistTarGz() {
}
/**
* Create a draft release PR
* Create a release PR
* @param {string} version Version
* @param {string} previousVersion Previous version tag
* @param {boolean} dryRun Still create the PR, but add "[DRY RUN]" to the title
@@ -608,21 +613,9 @@ The \`dist.tar.gz\` archive will be available as an artifact in the [workflow ru
`;
// Create the PR using gh CLI
const args = [
"pr",
"create",
"--title",
title,
"--body",
body,
"--base",
"master",
"--head",
branchName,
"--draft",
];
const args = ["pr", "create", "--title", title, "--body", body, "--base", "master", "--head", branchName];
console.log(`Creating draft PR: ${title}`);
console.log(`Creating PR: ${title}`);
const result = childProcess.spawnSync("gh", args, {
encoding: "utf-8",
@@ -650,7 +643,7 @@ The \`dist.tar.gz\` archive will be available as an artifact in the [workflow ru
console.warn("Could not extract PR number from URL, auto-finish will not be possible");
}
console.log("Successfully created draft pull request");
console.log("Successfully created pull request");
return prNumber;
}
+2 -2
View File
@@ -2,7 +2,7 @@
// 1. Validate version format
// 2. Reuse the existing open release PR if there is one (safe to re-run)
// 3. Otherwise create the release branch (--setup-branch, used by GitHub Actions),
// bump the version (commit + push), and create a draft PR
// bump the version (commit + push), and create a PR
//
// Usage: node extra/release/prepare-release.mjs [--setup-branch]
@@ -71,7 +71,7 @@ export async function runPrepare({ setupBranch = false } = {}) {
}
// Bump the version, commit and force push the branch
await import("../update-version.mjs");
await import("./update-version.mjs");
// Create Pull Request (gh pr create will handle pushing the branch)
return await createReleasePR(version, previousVersion, dryRun, branchName, githubRunId);
@@ -1,15 +1,12 @@
import { createRequire } from "module";
import semver from "semver";
import { isBetaRelease } from "./release/lib.mjs";
import { isBetaRelease } from "./lib.mjs";
const require = createRequire(import.meta.url);
const pkg = require("../package.json");
const pkg = require("../../package.json");
const fs = require("fs");
const childProcess = require("child_process");
const util = require("../src/util");
util.polyfill();
const version = process.env.RELEASE_VERSION;
const isBeta = isBetaRelease();
@@ -50,7 +47,7 @@ if (!exists) {
console.error("error npm version!");
process.exit(1);
}
const resultInstall = childProcess.spawnSync(npm, ["install"], { shell: true });
const resultInstall = childProcess.spawnSync(npm, ["install", "--package-lock-only"], { shell: true });
if (resultInstall.error) {
console.error(resultInstall.error);
console.error("error update package-lock!");
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "uptime-kuma",
"version": "2.5.0",
"version": "2.5.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "uptime-kuma",
"version": "2.5.0",
"version": "2.5.1",
"license": "MIT",
"dependencies": {
"@grpc/grpc-js": "~1.8.22",
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "uptime-kuma",
"version": "2.5.0",
"version": "2.5.1",
"license": "MIT",
"repository": {
"type": "git",
@@ -44,7 +44,7 @@
"build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push",
"upload-artifacts": "node extra/release/upload-artifacts.mjs",
"upload-artifacts-beta": "node extra/release/upload-artifacts-beta.mjs",
"setup": "git checkout 2.5.0 && npm ci --omit dev --no-audit && npm run download-dist",
"setup": "git checkout 2.5.1 && npm ci --omit dev --no-audit && npm run download-dist",
"download-dist": "node extra/download-dist.js",
"mark-as-nightly": "node extra/mark-as-nightly.js",
"reset-password": "node extra/reset-password.js",
@@ -66,7 +66,7 @@
"start-dev-container": "cd docker && docker-compose -f docker-compose-dev.yml up --force-recreate",
"rebase-pr-to-1.23.X": "node extra/rebase-pr.js 1.23.X",
"reset-migrate-aggregate-table-state": "node extra/reset-migrate-aggregate-table-state.js",
"generate-changelog": "node ./extra/generate-changelog.mjs",
"generate-changelog": "node ./extra/release/generate-changelog.mjs",
"create-release": "node ./extra/release/create-release.mjs"
},
"dependencies": {
+1 -12
View File
@@ -11,7 +11,7 @@
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CONSOLE_STYLE_FgViolet = exports.CONSOLE_STYLE_FgLightBlue = exports.CONSOLE_STYLE_FgLightGreen = exports.CONSOLE_STYLE_FgOrange = exports.CONSOLE_STYLE_FgGray = exports.CONSOLE_STYLE_FgWhite = exports.CONSOLE_STYLE_FgCyan = exports.CONSOLE_STYLE_FgMagenta = exports.CONSOLE_STYLE_FgBlue = exports.CONSOLE_STYLE_FgYellow = exports.CONSOLE_STYLE_FgGreen = exports.CONSOLE_STYLE_FgRed = exports.CONSOLE_STYLE_FgBlack = exports.CONSOLE_STYLE_Hidden = exports.CONSOLE_STYLE_Reverse = exports.CONSOLE_STYLE_Blink = exports.CONSOLE_STYLE_Underscore = exports.CONSOLE_STYLE_Dim = exports.CONSOLE_STYLE_Bright = exports.CONSOLE_STYLE_Reset = exports.RESPONSE_BODY_LENGTH_MAX = exports.RESPONSE_BODY_LENGTH_DEFAULT = exports.PING_PER_REQUEST_TIMEOUT_DEFAULT = exports.PING_PER_REQUEST_TIMEOUT_MAX = exports.PING_PER_REQUEST_TIMEOUT_MIN = exports.PING_COUNT_DEFAULT = exports.PING_COUNT_MAX = exports.PING_COUNT_MIN = exports.PING_GLOBAL_TIMEOUT_DEFAULT = exports.PING_GLOBAL_TIMEOUT_MAX = exports.PING_GLOBAL_TIMEOUT_MIN = exports.PING_PACKET_SIZE_DEFAULT = exports.PING_PACKET_SIZE_MAX = exports.PING_PACKET_SIZE_MIN = exports.INCIDENT_PAGE_SIZE = exports.MIN_INTERVAL_SECOND = exports.SQL_DATETIME_FORMAT_WITHOUT_SECOND = exports.SQL_DATETIME_FORMAT = exports.SQL_DATE_FORMAT = exports.STATUS_PAGE_MAINTENANCE = exports.STATUS_PAGE_PARTIAL_DOWN = exports.STATUS_PAGE_ALL_UP = exports.STATUS_PAGE_ALL_DOWN = exports.MAINTENANCE = exports.PENDING = exports.UP = exports.DOWN = exports.appName = exports.isNode = exports.isDev = void 0;
exports.TYPES_WITH_DOMAIN_EXPIRY_SUPPORT_VIA_FIELD = exports.evaluateJsonQuery = exports.intHash = exports.localToUTC = exports.utcToLocal = exports.utcToISODateTime = exports.isoToUTCDateTime = exports.parseTimeFromTimeObject = exports.parseTimeObject = exports.getMonitorRelativeURL = exports.genSecret = exports.getCryptoRandomInt = exports.getRandomInt = exports.getRandomArbitrary = exports.TimeLogger = exports.polyfill = exports.log = exports.debug = exports.ucfirst = exports.sleep = exports.flipStatus = exports.badgeConstants = exports.CONSOLE_STYLE_BgGray = exports.CONSOLE_STYLE_BgWhite = exports.CONSOLE_STYLE_BgCyan = exports.CONSOLE_STYLE_BgMagenta = exports.CONSOLE_STYLE_BgBlue = exports.CONSOLE_STYLE_BgYellow = exports.CONSOLE_STYLE_BgGreen = exports.CONSOLE_STYLE_BgRed = exports.CONSOLE_STYLE_BgBlack = exports.CONSOLE_STYLE_FgPink = exports.CONSOLE_STYLE_FgBrown = void 0;
exports.TYPES_WITH_DOMAIN_EXPIRY_SUPPORT_VIA_FIELD = exports.evaluateJsonQuery = exports.intHash = exports.localToUTC = exports.utcToLocal = exports.utcToISODateTime = exports.isoToUTCDateTime = exports.parseTimeFromTimeObject = exports.parseTimeObject = exports.getMonitorRelativeURL = exports.genSecret = exports.getCryptoRandomInt = exports.getRandomInt = exports.getRandomArbitrary = exports.TimeLogger = exports.log = exports.debug = exports.ucfirst = exports.sleep = exports.flipStatus = exports.badgeConstants = exports.CONSOLE_STYLE_BgGray = exports.CONSOLE_STYLE_BgWhite = exports.CONSOLE_STYLE_BgCyan = exports.CONSOLE_STYLE_BgMagenta = exports.CONSOLE_STYLE_BgBlue = exports.CONSOLE_STYLE_BgYellow = exports.CONSOLE_STYLE_BgGreen = exports.CONSOLE_STYLE_BgRed = exports.CONSOLE_STYLE_BgBlack = exports.CONSOLE_STYLE_FgPink = exports.CONSOLE_STYLE_FgBrown = void 0;
const dayjs_1 = require("dayjs");
const jsonata = require("jsonata");
exports.isDev = process.env.NODE_ENV === "development";
@@ -257,17 +257,6 @@ class Logger {
}
}
exports.log = new Logger();
function polyfill() {
if (!String.prototype.replaceAll) {
String.prototype.replaceAll = function (str, newStr) {
if (Object.prototype.toString.call(str).toLowerCase() === "[object regexp]") {
return this.replace(str, newStr);
}
return this.replace(new RegExp(str, "g"), newStr);
};
}
}
exports.polyfill = polyfill;
class TimeLogger {
constructor() {
this.startTime = dayjs().valueOf();
-21
View File
@@ -409,27 +409,6 @@ declare global {
}
}
/**
* String.prototype.replaceAll() polyfill
* https://gomakethings.com/how-to-replace-a-section-of-a-string-with-another-one-with-vanilla-js/
* @author Chris Ferdinandi
* @license MIT
* @returns {void}
*/
export function polyfill() {
if (!String.prototype.replaceAll) {
String.prototype.replaceAll = function (str: string, newStr: string) {
// If a regex pattern
if (Object.prototype.toString.call(str).toLowerCase() === "[object regexp]") {
return this.replace(str, newStr);
}
// If a string
return this.replace(new RegExp(str, "g"), newStr);
};
}
}
export class TimeLogger {
startTime: number;