fix(release): restrict stable channels to main
This commit is contained in:
1 parent
47ef0177dc
commit
3060cc4614
4 files changed
+141
-9
No files matched your search
@@ -14,12 +14,12 @@ on:
|
||||
channel:
|
||||
description: "Release channel"
|
||||
required: false
|
||||
default: stable
|
||||
default: preview
|
||||
type: choice
|
||||
options:
|
||||
- preview
|
||||
- stable
|
||||
- nightly
|
||||
- preview
|
||||
version:
|
||||
description: "Stable version override (for example 1.2.3). Defaults to the version the latest nightly previewed."
|
||||
required: false
|
||||
@@ -67,15 +67,27 @@ jobs:
|
||||
with:
|
||||
script: |
|
||||
const {
|
||||
assertCommitOnDefaultBranch,
|
||||
assertReleaseSource,
|
||||
shouldReleaseNightly,
|
||||
resolveLatestNightlyCommit,
|
||||
} = require('./.github/scripts/check-nightly-release.cjs');
|
||||
|
||||
const dispatchChannel = process.env.DISPATCH_CHANNEL || 'preview';
|
||||
const releaseChannel = context.eventName === 'schedule'
|
||||
? 'nightly'
|
||||
: context.eventName === 'workflow_dispatch'
|
||||
? dispatchChannel
|
||||
: 'stable';
|
||||
|
||||
await assertReleaseSource({ github, context, releaseChannel });
|
||||
|
||||
if (context.eventName === 'schedule') {
|
||||
core.setOutput('has_changes', await shouldReleaseNightly({ github, context, core }));
|
||||
core.setOutput('ref', context.sha);
|
||||
} else if (context.eventName === 'workflow_dispatch' && process.env.DISPATCH_CHANNEL !== 'nightly' && process.env.DISPATCH_CHANNEL !== 'preview') {
|
||||
} else if (context.eventName === 'workflow_dispatch' && dispatchChannel === 'stable') {
|
||||
const { tag, sha, version } = await resolveLatestNightlyCommit({ github, context, core });
|
||||
await assertCommitOnDefaultBranch({ github, context, sha });
|
||||
core.notice(`Stable release builds ${sha}, the commit shipped by ${tag}.`);
|
||||
core.setOutput('ref', sha);
|
||||
core.setOutput('nightly_version', version);
|
||||
@@ -133,7 +145,7 @@ jobs:
|
||||
NIGHTLY_SHA: ${{ needs.resolve_commit.outputs.ref }}
|
||||
NIGHTLY_RUN_NUMBER: ${{ github.run_number }}
|
||||
run: |
|
||||
if [[ "${GITHUB_EVENT_NAME}" == "schedule" || ( "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${DISPATCH_CHANNEL:-stable}" == "nightly" ) ]]; then
|
||||
if [[ "${GITHUB_EVENT_NAME}" == "schedule" || ( "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${DISPATCH_CHANNEL:-preview}" == "nightly" ) ]]; then
|
||||
nightly_date="$(date -u -d "$NIGHTLY_DATE" +%Y%m%d)"
|
||||
|
||||
node scripts/resolve-nightly-release.ts \
|
||||
@@ -146,7 +158,7 @@ jobs:
|
||||
echo "cli_dist_tag=nightly" >> "$GITHUB_OUTPUT"
|
||||
echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
|
||||
echo "make_latest=false" >> "$GITHUB_OUTPUT"
|
||||
elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${DISPATCH_CHANNEL:-stable}" == "preview" ]]; then
|
||||
elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${DISPATCH_CHANNEL:-preview}" == "preview" ]]; then
|
||||
# Manual-only test train: exercises the whole release flow for a
|
||||
# commit end users must never receive. Never scheduled.
|
||||
# Same versioning as nightly under its own prerelease identifier.
|
||||
|
||||
Reference in new issue
Block a user