@inditextech/docouture-cli 1.1.0 → 1.1.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.
|
@@ -20,7 +20,7 @@ name: docouture-release
|
|
|
20
20
|
# branch roles mean (trunk-based: both the same branch; git-flow: two
|
|
21
21
|
# independently-named branches, e.g. `develop`/`main`).
|
|
22
22
|
#
|
|
23
|
-
#
|
|
23
|
+
# Three ways to run this, all deliberate acts rather than a side effect of an
|
|
24
24
|
# ordinary push:
|
|
25
25
|
#
|
|
26
26
|
# 1. workflow_dispatch — a person runs it by hand and supplies `version`
|
|
@@ -32,6 +32,28 @@ name: docouture-release
|
|
|
32
32
|
# versioned reads it from `docs/.release-version`, a plain-text file
|
|
33
33
|
# the PR itself commits with the target version — reviewed as part of
|
|
34
34
|
# that PR's diff, like any other change.
|
|
35
|
+
# 3. Automatically, whenever a GitHub Release is published on this repo.
|
|
36
|
+
# Irrelevant unless this repo ALSO cuts its own code releases some other
|
|
37
|
+
# way, labelling the merged PR `release-type/*` (optionally
|
|
38
|
+
# `skip-release`) the way docouture's own repo does — nothing scaffolds
|
|
39
|
+
# that convention here, so on a fresh `docouture new` site this trigger
|
|
40
|
+
# simply never fires and the job below always takes path #2 instead.
|
|
41
|
+
# Kept anyway, disabled by omission rather than left out, so adopting
|
|
42
|
+
# that convention later is a label/workflow change only, not a rewrite
|
|
43
|
+
# of this file too.
|
|
44
|
+
#
|
|
45
|
+
# Where it does apply: this overlaps with #2 — a single merged PR can
|
|
46
|
+
# carry BOTH `docs/release` and a `release-type/*` label (releasing
|
|
47
|
+
# code and docs together). If it did, and #2 fired unconditionally,
|
|
48
|
+
# this workflow would run twice for the one merge — once immediately
|
|
49
|
+
# (the `pull_request` close) and again once that other release job
|
|
50
|
+
# finishes and publishes its Release (the trigger added here). The
|
|
51
|
+
# job's own `if:` below avoids that: the `pull_request` branch only
|
|
52
|
+
# fires when a code release is NOT also about to happen for the same
|
|
53
|
+
# merge (no `release-type/*` label, or `skip-release` overrides it) —
|
|
54
|
+
# otherwise it backs off and leaves the job to trigger #3 instead, once
|
|
55
|
+
# that other workflow actually finishes. Either way this runs exactly
|
|
56
|
+
# once per merge, just not always at the same moment.
|
|
35
57
|
#
|
|
36
58
|
# Republishing (versioned only): a fix that needs to land on an
|
|
37
59
|
# already-released version overwrites that version's tag — this workflow
|
|
@@ -57,6 +79,8 @@ on:
|
|
|
57
79
|
pull_request:
|
|
58
80
|
types: [closed]
|
|
59
81
|
branches: ['__DOCOUTURE_RELEASE_BRANCH__*']
|
|
82
|
+
release:
|
|
83
|
+
types: [published]
|
|
60
84
|
|
|
61
85
|
permissions:
|
|
62
86
|
contents: write
|
|
@@ -81,16 +105,23 @@ jobs:
|
|
|
81
105
|
defaults:
|
|
82
106
|
run:
|
|
83
107
|
working-directory: docs
|
|
84
|
-
# workflow_dispatch
|
|
85
|
-
#
|
|
86
|
-
# the release branch — including ones that were
|
|
87
|
-
# merged without the label — so it only proceeds
|
|
88
|
-
#
|
|
89
|
-
#
|
|
108
|
+
# workflow_dispatch and a published Release both always proceed (already
|
|
109
|
+
# explicit, deliberate acts). The pull_request trigger fires on every
|
|
110
|
+
# close of a PR targeting the release branch — including ones that were
|
|
111
|
+
# closed unmerged, or merged without the label — so it only proceeds
|
|
112
|
+
# when merged, carrying `docs/release`, AND a same-merge code release is
|
|
113
|
+
# NOT also about to fire under the `release-type`/`skip-release`
|
|
114
|
+
# convention (see this file's own header comment on trigger #2/#3 — a
|
|
115
|
+
# no-op on a site that doesn't use that convention, since
|
|
116
|
+
# `release-type`/`skip-release` labels then never exist to contain).
|
|
117
|
+
# Anything else is a no-op run, not an error.
|
|
90
118
|
if: >-
|
|
91
119
|
github.event_name == 'workflow_dispatch' ||
|
|
120
|
+
github.event_name == 'release' ||
|
|
92
121
|
(github.event.pull_request.merged == true &&
|
|
93
|
-
contains(github.event.pull_request.labels.*.name, 'docs/release')
|
|
122
|
+
contains(github.event.pull_request.labels.*.name, 'docs/release') &&
|
|
123
|
+
(contains(github.event.pull_request.labels.*.name, 'skip-release') ||
|
|
124
|
+
!contains(join(github.event.pull_request.labels.*.name, ', '), 'release-type')))
|
|
94
125
|
steps:
|
|
95
126
|
- name: Require release branch
|
|
96
127
|
# Only meaningful for a manual dispatch: someone could run this
|
package/package.json
CHANGED