@@ -2,7 +2,11 @@ name: Promote Nightly to Pre-release
22
33# Promotes a vetted nightly build to pre-release on VS Code Marketplace and Open VSX.
44#
5- # Usage:
5+ # Two modes:
6+ # 1. Auto-detect (default): finds oldest unpromoted nightly ≥ min-tag-age-days
7+ # 2. Specific tag: publishes a specific release tag (for emergency pre-releases)
8+ #
9+ # Usage - Auto-detect mode:
610# jobs:
711# promote:
812# uses: salesforcecli/github-workflows/.github/workflows/vscode-promote-prerelease.yml@main
@@ -15,20 +19,33 @@ name: Promote Nightly to Pre-release
1519# dry-run: 'false'
1620# secrets: inherit
1721#
22+ # Usage - Specific tag mode (emergency pre-releases):
23+ # jobs:
24+ # promote:
25+ # uses: salesforcecli/github-workflows/.github/workflows/vscode-promote-prerelease.yml@main
26+ # with:
27+ # release-tag: 'v67.13.7-nightly.develop.20260820' # specific tag to publish
28+ # extension-name: 'apex-lsp-vscode-extension'
29+ # secrets: inherit
30+ #
1831# Requirements - calling repository must have:
1932# - Nightly tags matching *-nightly.* (e.g., v1.2.3-nightly.20260629)
2033# - GitHub releases for each nightly tag with VSIX file(s) attached
2134# - Passing CI checks on nightly commits
2235# - Secrets: IDEE_GH_TOKEN, VSCE_PERSONAL_ACCESS_TOKEN, IDEE_OVSX_PAT
2336#
24- # Workflow: finds oldest unpromoted nightly ≥ min -tag-age-days → verifies CI →
37+ # Workflow: finds eligible nightly (or uses release -tag) → verifies CI →
2538# downloads VSIX → publishes to both marketplaces → creates tracking tag
2639
2740on :
2841 workflow_call :
2942 inputs :
43+ release-tag :
44+ description : " Specific release tag to publish (e.g., v67.13.7-nightly.develop.20260820). Overrides min-tag-age-days auto-detection."
45+ required : false
46+ type : string
3047 min-tag-age-days :
31- description : " Minimum nightly age in days before eligible for promotion"
48+ description : " Minimum nightly age in days before eligible for promotion (ignored if release-tag provided) "
3249 required : false
3350 default : " 7"
3451 type : string
6380 type : string
6481 workflow_dispatch :
6582 inputs :
83+ release-tag :
84+ description : " Specific release tag to publish (e.g., v67.13.7-nightly.develop.20260820). Overrides min-tag-age-days auto-detection."
85+ required : false
86+ type : string
6687 min-tag-age-days :
67- description : " Minimum nightly age in days before eligible for promotion (default: 7)"
88+ description : " Minimum nightly age in days before eligible for promotion (default: 7, ignored if release-tag provided )"
6889 required : false
6990 default : " 7"
7091 type : string
@@ -129,8 +150,27 @@ jobs:
129150 - name : Find eligible nightly
130151 id : find
131152 env :
153+ RELEASE_TAG : ${{ inputs.release-tag || '' }}
132154 MIN_TAG_AGE_DAYS : ${{ inputs.min-tag-age-days || '7' }}
133155 run : |
156+ # If specific release-tag provided, use it directly
157+ if [ -n "$RELEASE_TAG" ]; then
158+ echo "Using specific release tag: $RELEASE_TAG"
159+
160+ # Verify tag exists
161+ if ! git rev-parse "$RELEASE_TAG" >/dev/null 2>&1; then
162+ echo "::error::Release tag $RELEASE_TAG does not exist"
163+ exit 1
164+ fi
165+
166+ COMMIT_SHA=$(git rev-parse "$RELEASE_TAG^{commit}")
167+ echo "nightly-tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
168+ echo "commit-sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
169+ echo "✓ Found release tag: $RELEASE_TAG (commit: $COMMIT_SHA)"
170+ exit 0
171+ fi
172+
173+ # Auto-detect mode: find nightly tags older than MIN_TAG_AGE_DAYS
134174 echo "Finding nightly tags older than $MIN_TAG_AGE_DAYS days..."
135175
136176 # Get all nightly tags sorted by date (newest first)
0 commit comments