@@ -48,23 +48,26 @@ jobs:
4848 steps :
4949 - name : Verify branch
5050 run : |
51- if [ "${{ github.ref } }" != "refs/heads/main" ]; then
51+ if [ "${GITHUB_REF }" != "refs/heads/main" ]; then
5252 echo "❌ Error: Releases can only be triggered from main branch"
53- echo "Current ref: ${{ github.ref } }"
53+ echo "Current ref: ${GITHUB_REF }"
5454 exit 1
5555 fi
5656 - name : Confirm major release
5757 if : ${{ inputs.version == 'major' || inputs.version == 'premajor' }}
5858 run : |
59- if [ "${{ inputs.confirm_major } }" != "RELEASE MAJOR" ]; then
59+ if [ "${INPUTS_CONFIRM_MAJOR }" != "RELEASE MAJOR" ]; then
6060 echo "❌ For major/premajor releases, set confirm_major to RELEASE MAJOR"
6161 exit 1
6262 fi
63+ env :
64+ INPUTS_CONFIRM_MAJOR : ${{ inputs.confirm_major }}
6365 - name : Checkout repository
6466 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
6567 with :
6668 fetch-depth : 0
6769 token : ${{ secrets.GH_ACCESS_TOKEN }}
70+ persist-credentials : false
6871
6972 - name : Setup pnpm
7073 uses : pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
7477 with :
7578 node-version : 24
7679 registry-url : " https://registry.npmjs.org"
80+ cache : " " # Disable cache for release workflow (publishes to npm)
7781
7882 - name : Configure Git
7983 env :
@@ -98,11 +102,14 @@ jobs:
98102
99103 - name : Determine release parameters
100104 id : release-params
105+ env :
106+ INPUTS_VERSION : ${{ inputs.version }}
107+ INPUTS_PRERELEASE_TYPE : ${{ inputs.prerelease_type }}
101108 run : |
102- version_type="${{ inputs.version } }"
109+ version_type="${INPUTS_VERSION }"
103110
104111 if [ "$version_type" = "prepatch" ] || [ "$version_type" = "preminor" ] || [ "$version_type" = "premajor" ]; then
105- prerelease_type="${{ inputs.prerelease_type } }"
112+ prerelease_type="${INPUTS_PRERELEASE_TYPE }"
106113 if [ -z "$prerelease_type" ]; then
107114 echo "❌ Error: prerelease_type must be specified when version is prepatch/preminor/premajor"
108115 exit 1
@@ -200,17 +207,21 @@ jobs:
200207 env :
201208 GITHUB_TOKEN : ${{ secrets.GH_ACCESS_TOKEN }}
202209 NPM_CONFIG_TAG : ${{ steps.release-params.outputs.tag }}
210+ STEPS_RELEASE_PARAMS_OUTPUTS_RELEASE_INCREMENT : ${{ steps.release-params.outputs.release_increment }}
211+ STEPS_RELEASE_PARAMS_OUTPUTS_PRE_RELEASE_FLAG : ${{ steps.release-params.outputs.pre_release_flag }}
203212 run : |
204- pnpm exec release-it ${{ steps.release-params.outputs.release_increment }} ${{ steps.release-params.outputs.pre_release_flag } } --ci --config .release-it.ci.json
213+ pnpm exec release-it ${STEPS_RELEASE_PARAMS_OUTPUTS_RELEASE_INCREMENT} ${STEPS_RELEASE_PARAMS_OUTPUTS_PRE_RELEASE_FLAG } --ci --config .release-it.ci.json
205214
206215 - name : Run release-it (dry run)
207216 if : inputs.dry_run == true
208217 env :
209218 GITHUB_TOKEN : ${{ secrets.GH_ACCESS_TOKEN }}
210219 NPM_CONFIG_TAG : ${{ steps.release-params.outputs.tag }}
220+ STEPS_RELEASE_PARAMS_OUTPUTS_RELEASE_INCREMENT : ${{ steps.release-params.outputs.release_increment }}
221+ STEPS_RELEASE_PARAMS_OUTPUTS_PRE_RELEASE_FLAG : ${{ steps.release-params.outputs.pre_release_flag }}
211222 run : |
212223 echo "🧪 Running in DRY RUN mode - no changes will be pushed"
213- pnpm exec release-it ${{ steps.release-params.outputs.release_increment }} ${{ steps.release-params.outputs.pre_release_flag } } --ci --config .release-it.ci.json --dry-run
224+ pnpm exec release-it ${STEPS_RELEASE_PARAMS_OUTPUTS_RELEASE_INCREMENT} ${STEPS_RELEASE_PARAMS_OUTPUTS_PRE_RELEASE_FLAG } --ci --config .release-it.ci.json --dry-run
214225
215226 - name : Get version
216227 id : version
@@ -223,20 +234,20 @@ jobs:
223234 for pkg in packages/*/dist; do
224235 pkg_name=$(basename $(dirname $pkg))
225236 echo "Creating archive for $pkg_name..."
226- tar -czf release-artifacts/langfuse-js-sdk-${pkg_name}-${{ steps.version.outputs.version } }.tar.gz -C $(dirname $pkg) dist
237+ tar -czf release-artifacts/langfuse-js-sdk-${pkg_name}-${STEPS_VERSION_OUTPUTS_VERSION }.tar.gz -C $(dirname $pkg) dist
227238 done
228239 echo "Build artifacts:"
229240 ls -lh release-artifacts/
241+ env :
242+ STEPS_VERSION_OUTPUTS_VERSION : ${{ steps.version.outputs.version }}
230243
231244 - name : Upload release artifacts to GitHub Release
232245 if : inputs.dry_run == false
233- uses : softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2
234- with :
235- tag_name : v${{ steps.version.outputs.version }}
236- files : release-artifacts/*.tar.gz
237- fail_on_unmatched_files : true
246+ run : |
247+ gh release upload "v${VERSION}" release-artifacts/*.tar.gz --clobber
238248 env :
239- GITHUB_TOKEN : ${{ secrets.GH_ACCESS_TOKEN }}
249+ GH_TOKEN : ${{ secrets.GH_ACCESS_TOKEN }}
250+ VERSION : ${{ steps.version.outputs.version }}
240251
241252 - name : Notify Slack on success
242253 if : success() && inputs.dry_run == false
@@ -510,9 +521,11 @@ jobs:
510521 if : failure() && steps.release.outcome == 'success'
511522 run : |
512523 echo "⚠️ CRITICAL: Release succeeded but subsequent steps failed"
513- echo "Published version: v${{ steps.version.outputs.version } }"
524+ echo "Published version: v${STEPS_VERSION_OUTPUTS_VERSION }"
514525 echo "Manual intervention may be required"
515526 echo ""
516527 echo "Options:"
517528 echo "1. Re-run the workflow to complete GitHub release artifacts upload"
518- echo "2. Manually upload release artifacts for tag v${{ steps.version.outputs.version }}"
529+ echo "2. Manually upload release artifacts for tag v${STEPS_VERSION_OUTPUTS_VERSION}"
530+ env :
531+ STEPS_VERSION_OUTPUTS_VERSION : ${{ steps.version.outputs.version }}
0 commit comments