Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8babcb9554 | ||
|
|
6dd23ed874 | ||
|
|
5fccd3cc8c | ||
|
|
9398a5a2df | ||
|
|
29aafde84c | ||
|
|
dbb996dd4c |
No files matched your search
@@ -1,9 +1,9 @@
|
|||||||
name: Stage → Verdaccio
|
name: Stage → Verdaccio
|
||||||
|
|
||||||
# Staging publish. Runs on GITEA ONLY (the `if` guards against GitHub) for release
|
# Staging publish. Runs on GITEA ONLY (the `if` guards against GitHub) for release
|
||||||
# branches. Publishes the package as-is — version comes from package.json (a prerelease
|
# branches. Publishes prereleases to the internal Verdaccio under the `stg` dist-tag.
|
||||||
# like 26.8.0-beta.N) — to the internal Verdaccio under the `stg` dist-tag. Published
|
# Staging versions are intentionally mutable: an existing prerelease is removed before
|
||||||
# versions are immutable; fixes must increment the prerelease version.
|
# publishing the updated release candidate under the same version.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['release/**']
|
branches: ['release/**']
|
||||||
@@ -19,8 +19,8 @@ jobs:
|
|||||||
node-version: '22'
|
node-version: '22'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm audit
|
- run: npm audit
|
||||||
# `npm publish` runs prepublishOnly (lint + complexity + typecheck + test + build)
|
- name: Validate release candidate
|
||||||
# as its own gate before anything leaves the machine.
|
run: npm run prepublishOnly
|
||||||
- name: Publish prerelease to Verdaccio
|
- name: Publish prerelease to Verdaccio
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH }}
|
||||||
@@ -31,4 +31,5 @@ jobs:
|
|||||||
*-*) ;;
|
*-*) ;;
|
||||||
*) echo "Refusing to stage non-prerelease version: $VER" >&2; exit 1 ;;
|
*) echo "Refusing to stage non-prerelease version: $VER" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
npm publish --registry https://npm.svc.zoit.services --tag stg
|
npm unpublish "@green-tea/core@$VER" --registry https://npm.svc.zoit.services --force 2>/dev/null || true
|
||||||
|
npm publish --ignore-scripts --registry https://npm.svc.zoit.services --tag stg
|
||||||
@@ -4,6 +4,14 @@
|
|||||||
"description": "A zen, opinionated, type-safe framework — your API is a graph, not a middleware chain.",
|
"description": "A zen, opinionated, type-safe framework — your API is a graph, not a middleware chain.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "green-tea contributors",
|
"author": "green-tea contributors",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/Expressive-Tea/green-tea.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/Expressive-Tea/green-tea/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://green-tea.expressive-tea.io/docs/",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"http",
|
"http",
|
||||||
"framework",
|
"framework",
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { resolve } from 'node:path';
|
||||||
|
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
|
interface PackageMetadata {
|
||||||
|
readonly repository?: {
|
||||||
|
readonly type?: string;
|
||||||
|
readonly url?: string;
|
||||||
|
};
|
||||||
|
readonly bugs?: {
|
||||||
|
readonly url?: string;
|
||||||
|
};
|
||||||
|
readonly homepage?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const packageJson = JSON.parse(readFileSync(resolve(process.cwd(), 'package.json'), 'utf8')) as PackageMetadata;
|
||||||
|
|
||||||
|
describe('package publication metadata', () => {
|
||||||
|
it('links npm provenance to the public GitHub repository', () => {
|
||||||
|
expect(packageJson.repository).toEqual({
|
||||||
|
type: 'git',
|
||||||
|
url: 'git+https://github.com/Expressive-Tea/green-tea.git',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('links npm consumers to support and documentation', () => {
|
||||||
|
expect(packageJson.bugs).toEqual({
|
||||||
|
url: 'https://github.com/Expressive-Tea/green-tea/issues',
|
||||||
|
});
|
||||||
|
expect(packageJson.homepage).toBe('https://green-tea.expressive-tea.io/docs/');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { resolve } from 'node:path';
|
||||||
|
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
|
const workflow = readFileSync(resolve(process.cwd(), '.github/workflows/stage.yml'), 'utf8');
|
||||||
|
|
||||||
|
describe('Verdaccio staging workflow', () => {
|
||||||
|
it('replaces mutable prereleases only from release branches', () => {
|
||||||
|
expect(workflow).toContain("branches: ['release/**']");
|
||||||
|
expect(workflow).toContain('npm audit');
|
||||||
|
expect(workflow).toContain('npm run prepublishOnly');
|
||||||
|
expect(workflow).toContain('npm unpublish');
|
||||||
|
expect(workflow).toContain('npm publish --ignore-scripts');
|
||||||
|
expect(workflow).not.toContain('scripts/staging-integrity.ts');
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in new issue
Block a user