@inditextech/docouture-cli 0.1.0-SNAPSHOT.52.1 → 0.1.0-SNAPSHOT.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/new.js +6 -5
- package/build/commands/upgrade.js +4 -0
- package/build/lib/copy-template.js +1 -0
- package/build/lib/detect-package-manager.js +28 -1
- package/build/lib/dev-server.js +1 -1
- package/build/templates/starter/antora-playbook.local.yml +1 -1
- package/build/templates/starter/antora-playbook.versioned.yml +3 -3
- package/build/templates/starter/antora-playbook.yml +3 -3
- package/build/templates/starter/package.json +1 -0
- package/build/templates/starter/src/modules/main/pages/getting-started.adoc +3 -3
- package/build/templates/workflows/docouture-kroki-cache-warm.yml +9 -0
- package/build/templates/workflows/docouture-pr-verify.yml +8 -0
- package/build/templates/workflows/docouture-publish.yml +18 -1
- package/build/templates/workflows/docouture-release-preview.yml +3 -3
- package/build/templates/workflows/docouture-release.yml +46 -17
- package/package.json +1 -1
package/build/commands/new.js
CHANGED
|
@@ -20,11 +20,11 @@ const NAME_PATTERN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
|
|
|
20
20
|
// releasable configurations handled by the templated docouture-release.yml — see
|
|
21
21
|
// the docs-site-package skill's reference/versioning-modes.md. 'standalone'
|
|
22
22
|
// (the default): `main` always builds as the prerelease/preview version, and
|
|
23
|
-
// a release just force-moves a rolling `stable` tag — no historical archive,
|
|
23
|
+
// a release just force-moves a rolling `docs/stable` tag — no historical archive,
|
|
24
24
|
// appropriate for a product where only "now" and "what's next" matter.
|
|
25
25
|
// 'versioned': `main` builds as the prerelease version too — docs/antora.yml
|
|
26
26
|
// is identical to the standalone shape on main, for both modes — but every
|
|
27
|
-
// release is instead its own immutable `vX.Y.Z` git tag, kept forever —
|
|
27
|
+
// release is instead its own immutable `docs/vX.Y.Z` git tag, kept forever —
|
|
28
28
|
// appropriate for a library/SDK whose consumers pin an old version. (A bare,
|
|
29
29
|
// unversioned checkout — no prerelease/stable split at all — is not offered
|
|
30
30
|
// here: it only ever comes up as an ad-hoc `docouture dev` preview before a mode
|
|
@@ -220,12 +220,12 @@ async function promptWizard(io, initial, defaults) {
|
|
|
220
220
|
{
|
|
221
221
|
name: 'Standalone (Stable + Prerelease)',
|
|
222
222
|
value: 'standalone',
|
|
223
|
-
description: "main always builds as the prerelease/preview version; a release moves a rolling 'stable' tag — no historical archive kept.",
|
|
223
|
+
description: "main always builds as the prerelease/preview version; a release moves a rolling 'docs/stable' tag — no historical archive kept.",
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
226
|
name: 'Versioned (Full History)',
|
|
227
227
|
value: 'versioned',
|
|
228
|
-
description: 'main always builds as the prerelease/preview version; every release is an immutable vX.Y.Z git tag.',
|
|
228
|
+
description: 'main always builds as the prerelease/preview version; every release is an immutable docs/vX.Y.Z git tag.',
|
|
229
229
|
},
|
|
230
230
|
],
|
|
231
231
|
}, context));
|
|
@@ -394,6 +394,7 @@ export async function runNew(argv, io = defaultIO()) {
|
|
|
394
394
|
pmLockfile: pm.lockfile,
|
|
395
395
|
pmCiCmd: pm.ciCmd,
|
|
396
396
|
pmSetupStepYaml: pm.setupStepYaml,
|
|
397
|
+
pmPackageManagerField: pm.packageManagerField,
|
|
397
398
|
repoIgnoreGlob: repoIgnoreGlob(target),
|
|
398
399
|
};
|
|
399
400
|
// The whole starter subtree — package.json, antora-playbook.yml, its own
|
|
@@ -460,7 +461,7 @@ function printNextSteps(args) {
|
|
|
460
461
|
console.log(" 1. Create the 'docs/release' label (once): gh label create docs/release");
|
|
461
462
|
console.log(' 2. Open a PR that sets the target version in docs/.release-version (e.g. "1.0.0")');
|
|
462
463
|
console.log(" 3. Label the PR 'docs/release'");
|
|
463
|
-
console.log(' 4. Merge it — docouture-release.yml runs automatically and tags vX.Y.Z');
|
|
464
|
+
console.log(' 4. Merge it — docouture-release.yml runs automatically and tags docs/vX.Y.Z');
|
|
464
465
|
console.log('');
|
|
465
466
|
console.log(' (or skip the label/PR entirely: run docouture-release.yml manually via workflow_dispatch');
|
|
466
467
|
console.log(' and type the version)');
|
|
@@ -108,6 +108,10 @@ export async function runUpgrade(argv) {
|
|
|
108
108
|
pmLockfile: pm.lockfile,
|
|
109
109
|
pmCiCmd: pm.ciCmd,
|
|
110
110
|
pmSetupStepYaml: pm.setupStepYaml,
|
|
111
|
+
// Same reasoning as repoIgnoreGlob below: package.json (the only
|
|
112
|
+
// template file this placeholder appears in) is never re-copied by
|
|
113
|
+
// upgrade either, so there's nothing meaningful to compute it from.
|
|
114
|
+
pmPackageManagerField: 'unused-by-upgrade',
|
|
111
115
|
// upgrade never re-copies docs/ (see below) — package.json, the only
|
|
112
116
|
// template file this placeholder appears in, is never touched here — so
|
|
113
117
|
// there's nothing meaningful to compute it from. Not an empty string:
|
|
@@ -22,6 +22,7 @@ const PLACEHOLDERS = {
|
|
|
22
22
|
// value (which ends in its own `\n` — see packageManagerPlan) or the
|
|
23
23
|
// empty npm value drop cleanly in its place.
|
|
24
24
|
' # __DOCOUTURE_PM_SETUP_STEP__\n': 'pmSetupStepYaml',
|
|
25
|
+
__DOCOUTURE_PM_PACKAGE_MANAGER__: 'pmPackageManagerField',
|
|
25
26
|
// A bare token this time, unlike pmSetupStepYaml above — see
|
|
26
27
|
// TemplateValues.repoIgnoreGlob's own comment for why the whole-segment
|
|
27
28
|
// trick doesn't survive here.
|
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
import { execFileSync } from 'node:child_process';
|
|
2
3
|
import { readFileSync, existsSync } from 'node:fs';
|
|
3
4
|
import { join } from 'node:path';
|
|
4
5
|
const PNPM_ACTION_SETUP_STEP = ' - name: Setup pnpm\n' +
|
|
5
|
-
' uses: pnpm/action-setup@
|
|
6
|
+
' uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4\n' +
|
|
7
|
+
' with:\n' +
|
|
8
|
+
// `package_json_file` "must be relative to the repository root
|
|
9
|
+
// (GITHUB_WORKSPACE)" per the action's own action.yml — its default
|
|
10
|
+
// ('package.json') looks at the true repo root, not this site's own
|
|
11
|
+
// docs/package.json, even though `defaults.run.working-directory: docs`
|
|
12
|
+
// applies everywhere else in this workflow. Same gotcha, same fix as
|
|
13
|
+
// setup-node's `cache-dependency-path` a few lines below.
|
|
14
|
+
' package_json_file: docs/package.json\n' +
|
|
6
15
|
'\n';
|
|
16
|
+
// The exact pnpm/npm version actually available wherever `docouture new` is
|
|
17
|
+
// running — queried directly rather than guessed, so the `packageManager`
|
|
18
|
+
// field this writes into the scaffolded package.json (see
|
|
19
|
+
// packageManagerPlan below) is always a real, installable version. Falls
|
|
20
|
+
// back to a pinned last-known-good version only if the binary can't be
|
|
21
|
+
// queried at all (e.g. a test sandbox with neither on PATH) — degrading
|
|
22
|
+
// gracefully rather than leaving the scaffold without a value that
|
|
23
|
+
// `pnpm/action-setup` (CI) and corepack (locally) both need.
|
|
24
|
+
function detectPackageManagerVersion(pm) {
|
|
25
|
+
try {
|
|
26
|
+
return execFileSync(pm, ['--version'], { encoding: 'utf8' }).trim();
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return pm === 'pnpm' ? '10.24.0' : '10.9.2';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
7
32
|
// Reads the invoking package manager off npm's own user-agent env var — set
|
|
8
33
|
// by npm, pnpm and yarn alike on every script/exec they run, e.g.
|
|
9
34
|
// 'pnpm/9.1.0 npm/? node/v20.11.0 darwin x64'. This is how `docouture new` was
|
|
@@ -64,6 +89,7 @@ export function packageManagerPlan(pm) {
|
|
|
64
89
|
lockfile: 'pnpm-lock.yaml',
|
|
65
90
|
cacheName: 'pnpm',
|
|
66
91
|
setupStepYaml: PNPM_ACTION_SETUP_STEP,
|
|
92
|
+
packageManagerField: `pnpm@${detectPackageManagerVersion('pnpm')}`,
|
|
67
93
|
};
|
|
68
94
|
}
|
|
69
95
|
return {
|
|
@@ -74,6 +100,7 @@ export function packageManagerPlan(pm) {
|
|
|
74
100
|
lockfile: 'package-lock.json',
|
|
75
101
|
cacheName: 'npm',
|
|
76
102
|
setupStepYaml: '',
|
|
103
|
+
packageManagerField: `npm@${detectPackageManagerVersion('npm')}`,
|
|
77
104
|
};
|
|
78
105
|
}
|
|
79
106
|
//# sourceMappingURL=detect-package-manager.js.map
|
package/build/lib/dev-server.js
CHANGED
|
@@ -309,7 +309,7 @@ export async function startDevServer(options) {
|
|
|
309
309
|
log(`serving ${root}`);
|
|
310
310
|
log(` http://localhost:${port}${basePath}/`);
|
|
311
311
|
const watchers = [
|
|
312
|
-
watchPath(join(siteRoot, '
|
|
312
|
+
watchPath(join(siteRoot, 'src')),
|
|
313
313
|
watchPath(join(siteRoot, 'antora-playbook.local.yml'), { recursive: false }),
|
|
314
314
|
];
|
|
315
315
|
void Promise.all(watchers);
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# docouture docs-site-package skill's reference/versioning-modes.md), the real
|
|
12
12
|
# `antora-playbook.yml` aggregates content from more than just whatever is
|
|
13
13
|
# checked out right now — versioned matches `branches: [main]` +
|
|
14
|
-
# `tags: ['v*']`, standalone matches `branches: [main]` + `tags: ['stable']`.
|
|
14
|
+
# `tags: ['docs/v*']`, standalone matches `branches: [main]` + `tags: ['docs/stable']`.
|
|
15
15
|
# A PR build (or a local build on a feature branch) is on a detached HEAD or
|
|
16
16
|
# a branch that is neither of those, so `main` and the version tag(s) are
|
|
17
17
|
# not resolved in that checkout — the real playbook either fails or silently
|
|
@@ -59,12 +59,12 @@ content:
|
|
|
59
59
|
# version — docs/antora.yml on this branch says `version: prerelease`,
|
|
60
60
|
# `prerelease: true`, the same as the standalone mode's shape (this
|
|
61
61
|
# descriptor is identical for both modes on main — see docs/antora.yml's
|
|
62
|
-
# own comment). `tags: ['v*']` matches every release tag (v1.2.0,
|
|
63
|
-
# v2.0.0, ...) docouture-release.yml cuts, each an immutable version with
|
|
62
|
+
# own comment). `tags: ['docs/v*']` matches every release tag (docs/v1.2.0,
|
|
63
|
+
# docs/v2.0.0, ...) docouture-release.yml cuts, each an immutable version with
|
|
64
64
|
# its own copy of docs/antora.yml — the version dropdown grows by one
|
|
65
65
|
# every release and nothing here ever needs editing again.
|
|
66
66
|
branches: [main]
|
|
67
|
-
tags: ['v*']
|
|
67
|
+
tags: ['docs/v*']
|
|
68
68
|
|
|
69
69
|
ui:
|
|
70
70
|
bundle:
|
|
@@ -60,13 +60,13 @@ content:
|
|
|
60
60
|
start_path: docs/src
|
|
61
61
|
# Standalone: `main` aggregates as the prerelease version —
|
|
62
62
|
# docs/antora.yml on this branch permanently says `version: prerelease`,
|
|
63
|
-
# `prerelease: true`. `stable` is a rolling tag that docouture-release.yml
|
|
63
|
+
# `prerelease: true`. `docs/stable` is a rolling tag that docouture-release.yml
|
|
64
64
|
# force-moves to a fresh one-off commit on every release, not a second
|
|
65
|
-
# long-lived branch. Until the first release, `stable` does not exist
|
|
65
|
+
# long-lived branch. Until the first release, `docs/stable` does not exist
|
|
66
66
|
# yet and this site builds with just the one (prerelease) version —
|
|
67
67
|
# that is expected, not an error.
|
|
68
68
|
branches: [main]
|
|
69
|
-
tags: ['stable']
|
|
69
|
+
tags: ['docs/stable']
|
|
70
70
|
|
|
71
71
|
ui:
|
|
72
72
|
bundle:
|
|
@@ -69,7 +69,7 @@ Two ways to trigger it:
|
|
|
69
69
|
xref:main:prerequisites.adoc[] — otherwise the merge is a silent no-op.
|
|
70
70
|
|
|
71
71
|
Under the hood this bumps the version recorded in `docs/antora.yml` and
|
|
72
|
-
moves the `stable` tag (or, in Versioned mode, cuts a new `vX.Y.Z` tag) —
|
|
72
|
+
moves the `docs/stable` tag (or, in Versioned mode, cuts a new `docs/vX.Y.Z` tag) —
|
|
73
73
|
see that workflow's own header comment for the full mechanism.
|
|
74
74
|
|
|
75
75
|
In *Versioned* mode, the target version for the *next* release is not typed
|
|
@@ -78,13 +78,13 @@ into a form — it comes from `docs/.release-version`, a plain-text file
|
|
|
78
78
|
|
|
79
79
|
. Edit `docs/.release-version` so it contains `1.0.0`
|
|
80
80
|
. Open a pull request with that change, labeled `docs/release`
|
|
81
|
-
. Merge it — `docouture-release.yml` reads the file, tags `v1.0.0`, and bumps
|
|
81
|
+
. Merge it — `docouture-release.yml` reads the file, tags `docs/v1.0.0`, and bumps
|
|
82
82
|
`docs/.release-version` forward to the next patch version afterwards so
|
|
83
83
|
the file is always ready for whatever comes next
|
|
84
84
|
|
|
85
85
|
(Or skip the PR: run `docouture-release.yml` manually via `workflow_dispatch` and
|
|
86
86
|
type the version into its `version` input.) *Standalone* mode has no such
|
|
87
|
-
file — every release always targets the same `stable` tag, so there is
|
|
87
|
+
file — every release always targets the same `docs/stable` tag, so there is
|
|
88
88
|
nothing to set beforehand.
|
|
89
89
|
|
|
90
90
|
`docouture version <value>` is a different, narrower tool: it directly
|
|
@@ -29,6 +29,15 @@ on:
|
|
|
29
29
|
push:
|
|
30
30
|
branches: ['main*']
|
|
31
31
|
|
|
32
|
+
# Least-privilege default: this job only checks out `main`, warms the
|
|
33
|
+
# Docker/Kroki image cache and writes it via actions/cache (a separate,
|
|
34
|
+
# token-independent cache API, not repository contents) — it never uses
|
|
35
|
+
# GITHUB_TOKEN itself, so it never needs more than read access. Declared
|
|
36
|
+
# explicitly rather than left to inherit whatever the repository/
|
|
37
|
+
# organization's default token permissions happen to be.
|
|
38
|
+
permissions:
|
|
39
|
+
contents: read
|
|
40
|
+
|
|
32
41
|
concurrency:
|
|
33
42
|
group: docouture-kroki-cache-warm
|
|
34
43
|
cancel-in-progress: true
|
|
@@ -19,6 +19,14 @@ name: docouture-pr-verify
|
|
|
19
19
|
on:
|
|
20
20
|
pull_request: {}
|
|
21
21
|
|
|
22
|
+
# Least-privilege default: this job only checks out the PR's own HEAD,
|
|
23
|
+
# builds it, and checks links — it never writes to the repository, comments
|
|
24
|
+
# on the PR, or otherwise uses GITHUB_TOKEN, so it never needs more than
|
|
25
|
+
# read access. Declared explicitly rather than left to inherit whatever the
|
|
26
|
+
# repository/organization's default token permissions happen to be.
|
|
27
|
+
permissions:
|
|
28
|
+
contents: read
|
|
29
|
+
|
|
22
30
|
concurrency:
|
|
23
31
|
group: docouture-pr-verify-${{ github.event.pull_request.number }}
|
|
24
32
|
cancel-in-progress: true
|
|
@@ -132,7 +132,24 @@ jobs:
|
|
|
132
132
|
# specifically (unused, and unnecessary to set, for any other publish
|
|
133
133
|
# target). See this file's own header comment for the `<target>`
|
|
134
134
|
# naming convention and where its options come from.
|
|
135
|
+
|
|
136
|
+
# Mints an installation token for a GitHub App that's on this repo's
|
|
137
|
+
# branch-ruleset bypass list, if `gh-pages` is protected by one
|
|
138
|
+
# (branch rulesets requiring PRs / status checks) — see issue #157 in
|
|
139
|
+
# InditexTech/docouture. The plain GITHUB_TOKEN identity is never on a
|
|
140
|
+
# ruleset's own bypass list, so pushing `gh-pages` below is otherwise
|
|
141
|
+
# rejected (GH013) on a protected repo without this. `APP_CLIENT_ID`
|
|
142
|
+
# (a variable) and `APP_PRIVATE_KEY` (a secret) are organization-level
|
|
143
|
+
# in InditexTech — set both at the org or repo level for whichever
|
|
144
|
+
# GitHub App is bypass-listed on this site's rules.
|
|
145
|
+
- name: Git app token
|
|
146
|
+
id: app-token
|
|
147
|
+
uses: actions/create-github-app-token@v3
|
|
148
|
+
with:
|
|
149
|
+
client-id: ${{ vars.APP_CLIENT_ID }}
|
|
150
|
+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
151
|
+
|
|
135
152
|
- name: Publish
|
|
136
153
|
run: npx docouture publish gh-pages
|
|
137
154
|
env:
|
|
138
|
-
GITHUB_TOKEN: ${{
|
|
155
|
+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
@@ -76,7 +76,7 @@ jobs:
|
|
|
76
76
|
*"v*"*) mode=versioned ;;
|
|
77
77
|
*stable*) mode=standalone ;;
|
|
78
78
|
*)
|
|
79
|
-
echo "::error::antora-playbook.yml's content.sources[] has tags: '${line}' — expected something matching 'v*' (versioned) or 'stable' (standalone)."
|
|
79
|
+
echo "::error::antora-playbook.yml's content.sources[] has tags: '${line}' — expected something matching 'docs/v*' (versioned) or 'docs/stable' (standalone)."
|
|
80
80
|
exit 1
|
|
81
81
|
;;
|
|
82
82
|
esac
|
|
@@ -100,10 +100,10 @@ jobs:
|
|
|
100
100
|
else
|
|
101
101
|
version=""
|
|
102
102
|
fi
|
|
103
|
-
tag="v${version}"
|
|
103
|
+
tag="docs/v${version}"
|
|
104
104
|
else
|
|
105
105
|
version="stable"
|
|
106
|
-
tag="stable"
|
|
106
|
+
tag="docs/stable"
|
|
107
107
|
fi
|
|
108
108
|
|
|
109
109
|
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
|
@@ -3,8 +3,8 @@ name: docouture-release
|
|
|
3
3
|
# Handles BOTH versioning modes — see the docouture docs-site-package skill's
|
|
4
4
|
# versioning-modes.md for the full mechanism. Which mode a site is on is
|
|
5
5
|
# detected, not asked: `docs/antora-playbook.yml`'s own content.sources[]
|
|
6
|
-
# tags permanently say `tags: ['v*']` under versioned (Full History) or
|
|
7
|
-
# `tags: ['stable']` under standalone (Stable + Prerelease) from the moment a
|
|
6
|
+
# tags permanently say `tags: ['docs/v*']` under versioned (Full History) or
|
|
7
|
+
# `tags: ['docs/stable']` under standalone (Stable + Prerelease) from the moment a
|
|
8
8
|
# site opts into either — see the `Detect mode` step below. `docs/antora.yml`
|
|
9
9
|
# on `main` is identical for both modes (`version: prerelease`,
|
|
10
10
|
# `prerelease: true`) and is never read for this. Adopting a mode in the
|
|
@@ -14,8 +14,8 @@ name: docouture-release
|
|
|
14
14
|
#
|
|
15
15
|
# Prerequisite, done once, not by this workflow: this site's own
|
|
16
16
|
# antora-playbook.yml content.sources[] must already match
|
|
17
|
-
# `branches: [main]` + `tags: ['v*']` (versioned) or `branches: [main]` +
|
|
18
|
-
# `tags: ['stable']` (standalone).
|
|
17
|
+
# `branches: [main]` + `tags: ['docs/v*']` (versioned) or `branches: [main]` +
|
|
18
|
+
# `tags: ['docs/stable']` (standalone).
|
|
19
19
|
#
|
|
20
20
|
# Two ways to run this, both deliberate acts rather than a side effect of an
|
|
21
21
|
# ordinary push:
|
|
@@ -24,7 +24,7 @@ name: docouture-release
|
|
|
24
24
|
# (versioned) or leaves it as the default (standalone).
|
|
25
25
|
# 2. Automatically, when a pull request carrying the `docs/release` label
|
|
26
26
|
# is merged into a branch matching `main*`. This path has no input to
|
|
27
|
-
# type a version into: standalone doesn't need one (always `stable`);
|
|
27
|
+
# type a version into: standalone doesn't need one (always `docs/stable`);
|
|
28
28
|
# versioned reads it from `docs/.release-version`, a plain-text file
|
|
29
29
|
# the PR itself commits with the target version — reviewed as part of
|
|
30
30
|
# that PR's diff, like any other change.
|
|
@@ -45,8 +45,8 @@ on:
|
|
|
45
45
|
version:
|
|
46
46
|
description: >-
|
|
47
47
|
Target version for a versioned release, e.g. 1.2.0 (becomes tag
|
|
48
|
-
v1.2.0). Leave as 'stable' for a standalone site — that mode's
|
|
49
|
-
target is always the 'stable' tag, this input is ignored there.
|
|
48
|
+
docs/v1.2.0). Leave as 'stable' for a standalone site — that mode's
|
|
49
|
+
target is always the 'docs/stable' tag, this input is ignored there.
|
|
50
50
|
required: true
|
|
51
51
|
type: string
|
|
52
52
|
default: 'stable'
|
|
@@ -103,13 +103,18 @@ jobs:
|
|
|
103
103
|
- name: Checkout
|
|
104
104
|
uses: actions/checkout@v4
|
|
105
105
|
with:
|
|
106
|
-
# Standalone moves an existing `stable` tag, which has to already
|
|
106
|
+
# Standalone moves an existing `docs/stable` tag, which has to already
|
|
107
107
|
# be reachable in history to be force-moved. Versioned only ever
|
|
108
108
|
# creates a brand-new tag on a brand-new commit and doesn't
|
|
109
109
|
# strictly need this, but the detect step below needs main's tip
|
|
110
110
|
# either way, and full history is harmless for that case.
|
|
111
111
|
fetch-depth: 0
|
|
112
112
|
ref: main
|
|
113
|
+
# Don't persist the ambient GITHUB_TOKEN's credentials — it isn't
|
|
114
|
+
# on this repo's branch-ruleset bypass list, and a local credential
|
|
115
|
+
# from actions/checkout would otherwise win over the app token's
|
|
116
|
+
# own credentials (set up below) when the git-push steps run.
|
|
117
|
+
persist-credentials: false
|
|
113
118
|
|
|
114
119
|
# __DOCOUTURE_PM_SETUP_STEP__
|
|
115
120
|
- name: Setup Node
|
|
@@ -194,9 +199,33 @@ jobs:
|
|
|
194
199
|
git config user.name "github-actions[bot]"
|
|
195
200
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
196
201
|
|
|
202
|
+
# Mints an installation token for a GitHub App that's on this repo's
|
|
203
|
+
# branch-ruleset bypass list, if `main`/`gh-pages` are protected by
|
|
204
|
+
# one (branch rulesets requiring PRs / status checks) — see issue #157
|
|
205
|
+
# in InditexTech/docouture. `Push release tag` and `Bump release
|
|
206
|
+
# descriptor` below both push straight to a branch/ref, and the plain
|
|
207
|
+
# GITHUB_TOKEN identity is never on a ruleset's own bypass list, so
|
|
208
|
+
# those pushes are rejected (GH013) on a protected repo without this.
|
|
209
|
+
# `APP_CLIENT_ID` (a variable) and `APP_PRIVATE_KEY` (a secret) are
|
|
210
|
+
# organization-level in InditexTech — set both at the org or repo
|
|
211
|
+
# level for whichever GitHub App is bypass-listed on this site's rules.
|
|
212
|
+
- name: Git app token
|
|
213
|
+
id: app-token
|
|
214
|
+
uses: actions/create-github-app-token@v3
|
|
215
|
+
with:
|
|
216
|
+
client-id: ${{ vars.APP_CLIENT_ID }}
|
|
217
|
+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
218
|
+
|
|
219
|
+
- name: Git app credentials
|
|
220
|
+
env:
|
|
221
|
+
APP_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
222
|
+
run: |
|
|
223
|
+
git config --global credential.helper store
|
|
224
|
+
echo "https://x-access-token:${APP_TOKEN}@github.com" >> ~/.git-credentials
|
|
225
|
+
|
|
197
226
|
# The one signal this workflow trusts: docs/antora-playbook.yml's own
|
|
198
|
-
# content.sources[] tags permanently say `tags: ['v*']` (versioned) or
|
|
199
|
-
# `tags: ['stable']` (standalone) from the moment a site opts into that
|
|
227
|
+
# content.sources[] tags permanently say `tags: ['docs/v*']` (versioned) or
|
|
228
|
+
# `tags: ['docs/stable']` (standalone) from the moment a site opts into that
|
|
200
229
|
# mode — see this file's header and versioning-modes.md. Anything else
|
|
201
230
|
# there is treated as misconfiguration, not a third mode. Unlike
|
|
202
231
|
# docs/antora.yml elsewhere in this job — which really means
|
|
@@ -213,7 +242,7 @@ jobs:
|
|
|
213
242
|
*"v*"*) mode=versioned ;;
|
|
214
243
|
*stable*) mode=standalone ;;
|
|
215
244
|
*)
|
|
216
|
-
echo "::error::antora-playbook.yml's content.sources[] has tags: '${line}' — expected something matching 'v*' (versioned) or 'stable' (standalone). See versioning-modes.md's 'Prerequisite' note."
|
|
245
|
+
echo "::error::antora-playbook.yml's content.sources[] has tags: '${line}' — expected something matching 'docs/v*' (versioned) or 'docs/stable' (standalone). See versioning-modes.md's 'Prerequisite' note."
|
|
217
246
|
exit 1
|
|
218
247
|
;;
|
|
219
248
|
esac
|
|
@@ -286,10 +315,10 @@ jobs:
|
|
|
286
315
|
run: |
|
|
287
316
|
if [ "$MODE" = "versioned" ]; then
|
|
288
317
|
value="$VERSION"
|
|
289
|
-
tag="v${value}"
|
|
318
|
+
tag="docs/v${value}"
|
|
290
319
|
else
|
|
291
320
|
value="stable"
|
|
292
|
-
tag="stable"
|
|
321
|
+
tag="docs/stable"
|
|
293
322
|
fi
|
|
294
323
|
|
|
295
324
|
base=$(git rev-parse HEAD)
|
|
@@ -312,7 +341,7 @@ jobs:
|
|
|
312
341
|
# (the tag already existed) must NOT bump docs/.release-version
|
|
313
342
|
# forward, since that file already holds whatever was planned to come
|
|
314
343
|
# after this republished version. Standalone has no equivalent need —
|
|
315
|
-
# `stable` is a rolling pointer, always overwritten, and there's no
|
|
344
|
+
# `docs/stable` is a rolling pointer, always overwritten, and there's no
|
|
316
345
|
# release-version file to protect.
|
|
317
346
|
- name: Check for existing release
|
|
318
347
|
if: steps.detect.outputs.mode == 'versioned'
|
|
@@ -329,8 +358,8 @@ jobs:
|
|
|
329
358
|
fi
|
|
330
359
|
|
|
331
360
|
# Every release tag is force-recreated if it already exists — both
|
|
332
|
-
# modes, unconditionally. Standalone's `stable` is a rolling pointer by
|
|
333
|
-
# design; versioned's vX.Y.Z tags are meant to be immutable once
|
|
361
|
+
# modes, unconditionally. Standalone's `docs/stable` is a rolling pointer by
|
|
362
|
+
# design; versioned's docs/vX.Y.Z tags are meant to be immutable once
|
|
334
363
|
# released, but a republish (fixing a released version) is a
|
|
335
364
|
# deliberate, ordinary act here, not something gated behind a separate
|
|
336
365
|
# flag or label.
|
|
@@ -343,7 +372,7 @@ jobs:
|
|
|
343
372
|
git push origin "refs/tags/${TAG}" --force
|
|
344
373
|
|
|
345
374
|
# Versioned only: every version is kept forever, so each one gets a
|
|
346
|
-
# real Release entry. Standalone deliberately skips this — `stable` is
|
|
375
|
+
# real Release entry. Standalone deliberately skips this — `docs/stable` is
|
|
347
376
|
# a rolling pointer with no changelog value of its own, and that mode
|
|
348
377
|
# keeps no version history to attach one to (see versioning-modes.md).
|
|
349
378
|
# The delete-then-create is a no-op the first time a version is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inditextech/docouture-cli",
|
|
3
|
-
"version": "0.1.0-SNAPSHOT.
|
|
3
|
+
"version": "0.1.0-SNAPSHOT.63.1",
|
|
4
4
|
"description": "Command-line tool for docouture documentation sites: scaffold a new site and set its Antora version outside the monorepo",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|