Skip to content

Commit c9a5754

Browse files
Merge branch 'main' into fix/sdk-e2e-bootstrap-downloads
2 parents 8329a4a + cc051a4 commit c9a5754

125 files changed

Lines changed: 6663 additions & 2453 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Download release artifact (with availability guard)
2+
description: >
3+
Download a build artifact produced earlier in the run. If the download fails
4+
(most commonly because the artifact expired while a release run waited for
5+
manual approval, but also on transient registry/network errors, a renamed
6+
artifact, or a permissions issue), fail fast with an actionable message
7+
instead of the cryptic "Artifact not found" download error.
8+
9+
inputs:
10+
name:
11+
description: "Artifact name to download"
12+
required: true
13+
path:
14+
description: "Destination path for the downloaded artifact"
15+
required: true
16+
17+
runs:
18+
using: composite
19+
steps:
20+
- name: Download build artifact
21+
id: dl
22+
continue-on-error: true
23+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
24+
with:
25+
name: ${{ inputs.name }}
26+
path: ${{ inputs.path }}
27+
28+
- name: Guard against unavailable artifact
29+
if: steps.dl.outcome == 'failure'
30+
shell: bash
31+
env:
32+
ARTIFACT_NAME: ${{ inputs.name }}
33+
run: |
34+
echo "::error title=Build artifact unavailable::The '${ARTIFACT_NAME}' build artifact could not be downloaded (see the download step log above for the underlying error). The most common cause is expiry: the GitHub Actions retention window elapsed while this run waited for release approval. If so, re-running ONLY the failed jobs will NOT help because the artifact is gone for good - re-run the ENTIRE workflow ('Re-run all jobs') or re-trigger it (push / workflow_dispatch) on the release branch so the build job regenerates the artifact before publish."
35+
exit 1

.github/actions/publish-library-to-npm/action.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,16 @@ runs:
111111
# Auto-decide the dist-tag on release branches when the caller did not
112112
# pass an explicit non-"latest" tag. Backports to older release-* lines
113113
# (where package.json version is lower than the current published
114-
# `latest`) are published under v<major>.<minor> so they never clobber
115-
# the homepage pointer. The newest release line auto-promotes `latest`.
114+
# `latest`) are published under release-<major>.<minor> so they never
115+
# clobber the homepage pointer. The newest release line auto-promotes
116+
# `latest`.
117+
#
118+
# The dist-tag MUST NOT be a valid SemVer range, because npm rejects
119+
# such tags ("Tag name must not be a valid SemVer range"). A bare
120+
# "v<major>.<minor>" (e.g. "v0.4") coerces to ">=0.4.0 <0.5.0" and is
121+
# refused, so the line tag is prefixed with "release-" to keep it a
122+
# plain identifier (matching the documented npm_tag override example
123+
# "release-1.x" used by the addon workflows).
116124
#
117125
# Triggered when:
118126
# - caller passed empty input (EXPLICIT_TAG=false), OR
@@ -178,13 +186,13 @@ runs:
178186
# otherwise win to the backport branch -- including the newest
179187
# line, which is the catastrophic case (no `latest` promotion
180188
# for a legitimate release).
181-
# 2. IS_PRERELEASE is checked separately and FORCES v<major>.<minor>
182-
# regardless of how core() compares. npm convention is that
183-
# `npm install <pkg>` should never pull a prerelease, so even a
184-
# prerelease whose core is >= current latest must NOT take the
185-
# `latest` tag. Consumers opt in via `npm i <pkg>@v<M>.<m>`,
186-
# or operators can override with an explicit npm_tag (e.g.
187-
# "next") on workflow_dispatch.
189+
# 2. IS_PRERELEASE is checked separately and FORCES
190+
# release-<major>.<minor> regardless of how core() compares. npm
191+
# convention is that `npm install <pkg>` should never pull a
192+
# prerelease, so even a prerelease whose core is >= current latest
193+
# must NOT take the `latest` tag. Consumers opt in via
194+
# `npm i <pkg>@release-<M>.<m>`, or operators can override with an
195+
# explicit npm_tag (e.g. "next") on workflow_dispatch.
188196
#
189197
# Removing either piece reintroduces a footgun. Keep both.
190198
IS_PRERELEASE=$(node -e 'console.log(/-/.test(process.argv[1]) ? "yes" : "no")' "$PACKAGE_VERSION")
@@ -199,13 +207,13 @@ runs:
199207
MAJOR_MINOR=$(echo "$PACKAGE_VERSION" | awk -F. '{print $1"."$2}')
200208
201209
if [ "$IS_PRERELEASE" = "yes" ]; then
202-
TAG="v${MAJOR_MINOR}"
210+
TAG="release-${MAJOR_MINOR}"
203211
REASON="prerelease $PACKAGE_VERSION never auto-promotes latest (current latest=$CURRENT_LATEST)"
204212
elif [ "$HIGHER" = "yes" ]; then
205213
TAG="latest"
206214
REASON="package.json version $PACKAGE_VERSION >= current latest $CURRENT_LATEST"
207215
else
208-
TAG="v${MAJOR_MINOR}"
216+
TAG="release-${MAJOR_MINOR}"
209217
REASON="package.json version $PACKAGE_VERSION < current latest $CURRENT_LATEST (backport)"
210218
fi
211219

0 commit comments

Comments
 (0)