@inditextech/docouture-cli 0.1.0-SNAPSHOT.64.1 → 0.1.0-SNAPSHOT.71.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.
@@ -6,7 +6,7 @@ name: docouture-release
6
6
  # tags permanently say `tags: ['docs/v*']` under versioned (Full History) or
7
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
- # on `main` is identical for both modes (`version: prerelease`,
9
+ # on the release branch is identical for both modes (`version: prerelease`,
10
10
  # `prerelease: true`) and is never read for this. Adopting a mode in the
11
11
  # first place (setting antora-playbook.yml's content.sources[] tags/branches)
12
12
  # is still a manual, one-time edit; this workflow only handles cutting
@@ -14,8 +14,11 @@ 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: ['docs/v*']` (versioned) or `branches: [main]` +
18
- # `tags: ['docs/stable']` (standalone).
17
+ # `branches: [__DOCOUTURE_PRERELEASE_BRANCH__]` + `tags: ['docs/v*']` (versioned) or
18
+ # `branches: [__DOCOUTURE_PRERELEASE_BRANCH__]` + `tags: ['docs/stable']` (standalone) —
19
+ # see the guides-branching-model guide for what the prerelease/release
20
+ # branch roles mean (trunk-based: both the same branch; git-flow: two
21
+ # independently-named branches, e.g. `develop`/`main`).
19
22
  #
20
23
  # Two ways to run this, both deliberate acts rather than a side effect of an
21
24
  # ordinary push:
@@ -23,7 +26,8 @@ name: docouture-release
23
26
  # 1. workflow_dispatch — a person runs it by hand and supplies `version`
24
27
  # (versioned) or leaves it as the default (standalone).
25
28
  # 2. Automatically, when a pull request carrying the `docs/release` label
26
- # is merged into a branch matching `main*`. This path has no input to
29
+ # is merged into a branch matching the release branch (see the
30
+ # guides-branching-model guide). This path has no input to
27
31
  # type a version into: standalone doesn't need one (always `docs/stable`);
28
32
  # versioned reads it from `docs/.release-version`, a plain-text file
29
33
  # the PR itself commits with the target version — reviewed as part of
@@ -34,11 +38,11 @@ name: docouture-release
34
38
  # always force-recreates a tag that already exists, both modes, no separate
35
39
  # flag or label needed. `docs/.release-version` itself is never cleared by
36
40
  # hand: after every successful versioned release that is NOT a republish,
37
- # this workflow bumps it forward to the next patch version on `main` (see
38
- # "Bump release descriptor" below), so the file always holds a sane next
39
- # target rather than going stale. A republish (the target tag already
40
- # existed) skips that bump, since `docs/.release-version` already holds
41
- # whatever was planned to come after it.
41
+ # this workflow bumps it forward to the next patch version on the release
42
+ # branch (see "Bump release descriptor" below), so the file always holds a
43
+ # sane next target rather than going stale. A republish (the target tag
44
+ # already existed) skips that bump, since `docs/.release-version` already
45
+ # holds whatever was planned to come after it.
42
46
  on:
43
47
  workflow_dispatch:
44
48
  inputs:
@@ -52,11 +56,10 @@ on:
52
56
  default: 'stable'
53
57
  pull_request:
54
58
  types: [closed]
55
- branches: ['main*']
59
+ branches: ['__DOCOUTURE_RELEASE_BRANCH__*']
56
60
 
57
61
  permissions:
58
62
  contents: write
59
- pull-requests: write
60
63
 
61
64
  concurrency:
62
65
  group: docouture-release
@@ -80,24 +83,25 @@ jobs:
80
83
  working-directory: docs
81
84
  # workflow_dispatch always proceeds (it's already an explicit, deliberate
82
85
  # act). The pull_request trigger fires on every close of a PR targeting
83
- # main* — including ones that were closed unmerged, or merged without the
84
- # label — so it only proceeds when both are true: actually merged, and
85
- # carrying `docs/release`. Anything else is a no-op run, not an error.
86
+ # the release branch — including ones that were closed unmerged, or
87
+ # merged without the label — so it only proceeds when both are true:
88
+ # actually merged, and carrying `docs/release`. Anything else is a
89
+ # no-op run, not an error.
86
90
  if: >-
87
91
  github.event_name == 'workflow_dispatch' ||
88
92
  (github.event.pull_request.merged == true &&
89
93
  contains(github.event.pull_request.labels.*.name, 'docs/release'))
90
94
  steps:
91
- - name: Require main
95
+ - name: Require release branch
92
96
  # Only meaningful for a manual dispatch: someone could run this
93
- # workflow with a non-main branch selected in the "Run workflow" UI.
94
- # The pull_request trigger can't have this problem — the `branches:`
95
- # filter above already restricted it to main* before the job started,
96
- # and by the time a `closed`+`merged` event fires, main already
97
- # reflects the merge.
98
- if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
97
+ # workflow with a different branch selected in the "Run workflow"
98
+ # UI. The pull_request trigger can't have this problem — the
99
+ # `branches:` filter above already restricted it to the release
100
+ # branch before the job started, and by the time a `closed`+`merged`
101
+ # event fires, that branch already reflects the merge.
102
+ if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/__DOCOUTURE_RELEASE_BRANCH__'
99
103
  run: |
100
- echo "::error::docouture-release must run against main (got ${{ github.ref }})"
104
+ echo "::error::docouture-release must run against __DOCOUTURE_RELEASE_BRANCH__ (got ${{ github.ref }})"
101
105
  exit 1
102
106
 
103
107
  - name: Checkout
@@ -106,10 +110,11 @@ jobs:
106
110
  # Standalone moves an existing `docs/stable` tag, which has to already
107
111
  # be reachable in history to be force-moved. Versioned only ever
108
112
  # creates a brand-new tag on a brand-new commit and doesn't
109
- # strictly need this, but the detect step below needs main's tip
110
- # either way, and full history is harmless for that case.
113
+ # strictly need this, but the detect step below needs the release
114
+ # branch's tip either way, and full history is harmless for that
115
+ # case.
111
116
  fetch-depth: 0
112
- ref: main
117
+ ref: __DOCOUTURE_RELEASE_BRANCH__
113
118
  # Don't persist the ambient GITHUB_TOKEN's credentials — it isn't
114
119
  # on this repo's branch-ruleset bypass list, and a local credential
115
120
  # from actions/checkout would otherwise win over the app token's
@@ -181,7 +186,8 @@ jobs:
181
186
  # yet, so the real playbook's tag-based content source can't see it —
182
187
  # it would just rebuild whatever was already released, not what's
183
188
  # about to ship. The local playbook validates exactly the content on
184
- # `main` right now, which is what the new version will actually be.
189
+ # the release branch right now, which is what the new version will
190
+ # actually be.
185
191
  - name: Build docs
186
192
  run: npx antora --fetch antora-playbook.local.yml
187
193
 
@@ -200,12 +206,13 @@ jobs:
200
206
  git config user.email "github-actions[bot]@users.noreply.github.com"
201
207
 
202
208
  # 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
+ # branch-ruleset bypass list, if the release branch/`gh-pages` are
210
+ # protected by one (branch rulesets requiring PRs / status checks) —
211
+ # see issue #157 in InditexTech/docouture. `Push release tag` and
212
+ # `Bump release descriptor` below both push straight to a branch/ref,
213
+ # and the plain GITHUB_TOKEN identity is never on a ruleset's own
214
+ # bypass list, so those pushes are rejected (GH013) on a protected
215
+ # repo without this.
209
216
  # `APP_CLIENT_ID` (a variable) and `APP_PRIVATE_KEY` (a secret) are
210
217
  # organization-level in InditexTech — set both at the org or repo
211
218
  # level for whichever GitHub App is bypass-listed on this site's rules.
@@ -299,14 +306,18 @@ jobs:
299
306
  echo "::warning::Standalone mode always releases to the 'stable' tag — ignoring provided version '${VERSION}'."
300
307
  fi
301
308
 
302
- # `main`'s own docs/antora.yml is never touched here — it permanently
303
- # says version: prerelease (both modes). This step patches a COMMIT,
304
- # not main itself: `docouture version <value>` edits the working tree,
305
- # that edit is committed on top of main's current tip, and then main
306
- # is reset back to that same tip immediately after — so the commit's
307
- # only route into the repository's reachable history is whichever tag
308
- # points at it next (pushed in the following step). It is deliberately
309
- # never pushed as part of `main`.
309
+ # The release branch's own docs/antora.yml is never touched here — it
310
+ # permanently says version: prerelease (both modes, trunk-based only
311
+ # — see the guides-branching-model guide for why this steady-state
312
+ # value stops being meaningful once the release branch is a distinct,
313
+ # git-flow branch: nothing reads it back in that case either way).
314
+ # This step patches a COMMIT, not the release branch itself:
315
+ # `docouture version <value>` edits the working tree, that edit is
316
+ # committed on top of the release branch's current tip, and then the
317
+ # release branch is reset back to that same tip immediately after —
318
+ # so the commit's only route into the repository's reachable history
319
+ # is whichever tag points at it next (pushed in the following step).
320
+ # It is deliberately never pushed as part of the release branch.
310
321
  - name: Cut release
311
322
  id: cut
312
323
  env:
@@ -328,9 +339,9 @@ jobs:
328
339
  git commit -m "chore: docs release ${tag}"
329
340
  sha=$(git rev-parse HEAD)
330
341
 
331
- # Detach main back to its real tip. The commit just made keeps
332
- # existing (git doesn't garbage-collect same-run objects), it's
333
- # just no longer what any local branch points at.
342
+ # Detach the release branch back to its real tip. The commit just
343
+ # made keeps existing (git doesn't garbage-collect same-run
344
+ # objects), it's just no longer what any local branch points at.
334
345
  git reset --hard "$base"
335
346
 
336
347
  echo "sha=${sha}" >> "$GITHUB_OUTPUT"
@@ -371,23 +382,23 @@ jobs:
371
382
  git tag -f "$TAG" "$SHA"
372
383
  git push origin "refs/tags/${TAG}" --force
373
384
 
374
- # Versioned only: every version is kept forever, so each one gets a
375
- # real Release entry. Standalone deliberately skips this — `docs/stable` is
376
- # a rolling pointer with no changelog value of its own, and that mode
377
- # keeps no version history to attach one to (see versioning-modes.md).
378
- # The delete-then-create is a no-op the first time a version is
379
- # released (nothing to delete); on a republish it drops the stale
380
- # Release object first so `create` doesn't just fail against one that
381
- # already exists.
382
- - name: Create GitHub Release
383
- if: steps.detect.outputs.mode == 'versioned'
384
- env:
385
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
386
- TAG: ${{ steps.cut.outputs.tag }}
387
- SHA: ${{ steps.cut.outputs.sha }}
388
- run: |
389
- gh release delete "$TAG" --yes 2>/dev/null || true
390
- gh release create "$TAG" --title "$TAG" --generate-notes --target "$SHA"
385
+ # Neither mode creates a GitHub Release object — `Push release tag` above
386
+ # is the last step of this dance for both. Versioned mode used to
387
+ # (`gh release create --generate-notes` here, deleting-then-recreating
388
+ # on a republish), but that Release was functionally inert: nothing
389
+ # reads it back — no workflow, no Antora extension, no CLI command; the
390
+ # version dropdown and `duplicate_latest_version` are driven purely by
391
+ # the tag itself plus Antora's own ref aggregation (see
392
+ # versioning-modes.md) — and it polluted the same Releases page/RSS/
393
+ # watch feed as this repo's real npm semver releases
394
+ # (code-npm_node-publish-release-and-snapshot.yml), which #166's `docs/`
395
+ # tag prefix alone didn't fully solve: a Release object still shows in
396
+ # that list regardless of what its tag is named. `--generate-notes`'s
397
+ # auto PR-list was dropped outright rather than relocated when this was
398
+ # removed — its value is already covered by the hand-authored
399
+ # `release-notes/<version>.adoc` page and the auto-generated
400
+ # `changelog/index.adoc` (built from CHANGELOG.md at build time). See
401
+ # GH #172.
391
402
 
392
403
  # Versioned only, and only on a genuine forward release (not a
393
404
  # republish of an already-released version — see "Check for existing
@@ -398,9 +409,9 @@ jobs:
398
409
  # workspace's own npm packages: let `npm version` do the semver
399
410
  # arithmetic against a throwaway package.json instead of hand-rolling
400
411
  # it, then read the result back out. This is a real commit directly on
401
- # `main` (unlike "Cut release" above, which deliberately never
402
- # advances main) — it's just bookkeeping, not a release. Skipped on a
403
- # republish: that run's target version was already superseded by
412
+ # the release branch (unlike "Cut release" above, which deliberately
413
+ # never advances it) — it's just bookkeeping, not a release. Skipped
414
+ # on a republish: that run's target version was already superseded by
404
415
  # whatever docs/.release-version currently holds, so bumping forward
405
416
  # from it would clobber that already-planned next target instead of
406
417
  # protecting it.
@@ -417,24 +428,25 @@ jobs:
417
428
  echo "${next}" > .release-version
418
429
  git add .release-version
419
430
  git commit -m "chore: bump docs/.release-version to ${next}"
420
- git push origin main
431
+ git push origin __DOCOUTURE_RELEASE_BRANCH__
421
432
 
422
433
  echo "docs/.release-version: ${VERSION} → ${next}"
423
434
 
424
435
  # Rebuild/deploy: called directly here, as a reusable job, rather than
425
436
  # relying on docouture-publish.yml's own trigger reacting to the pushes
426
437
  # above — a plain `on: push` there previously had two problems: (1) it
427
- # matched both the tag push above AND main's ordinary pushes, so an
428
- # unrelated commit to main (or this job's own release-version bump
429
- # commit, previously pushed to main directly) could kick off a publish
430
- # with nothing to do with a release, and (2) both this job's tag push
431
- # and its main push could each independently match, firing publish
432
- # twice for one release with no ordering guarantee between them. A
433
- # direct `needs:` job dependency below has neither problem: publish
434
- # only ever runs once, only after this job finishes, and only when it
435
- # actually cut something (`needs.release.result == 'success'` is
436
- # already false for a no-op run — see this job's own `if:` above,
437
- # which makes a run that doesn't match skip rather than succeed).
438
+ # matched both the tag push above AND the release branch's ordinary
439
+ # pushes, so an unrelated commit to it (or this job's own
440
+ # release-version bump commit, previously pushed to it directly)
441
+ # could kick off a publish with nothing to do with a release, and (2)
442
+ # both this job's tag push and its release-branch push could each
443
+ # independently match, firing publish twice for one release with no
444
+ # ordering guarantee between them. A direct `needs:` job dependency
445
+ # below has neither problem: publish only ever runs once, only after
446
+ # this job finishes, and only when it actually cut something
447
+ # (`needs.release.result == 'success'` is already false for a no-op
448
+ # run — see this job's own `if:` above, which makes a run that
449
+ # doesn't match skip rather than succeed).
438
450
  publish:
439
451
  name: Publish
440
452
  needs: release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inditextech/docouture-cli",
3
- "version": "0.1.0-SNAPSHOT.64.1",
3
+ "version": "0.1.0-SNAPSHOT.71.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",