From eaadc6d93d92b5933ac4e82f86484ff866884c75 Mon Sep 17 00:00:00 2001 From: matt korwel Date: Fri, 12 Sep 2025 09:58:28 -0700 Subject: [PATCH] refactor(release): simplify release workflow (#8353) --- .github/workflows/release.yml | 54 +++++++---------------------------- 1 file changed, 11 insertions(+), 43 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9774f2e66c..638211f06f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,11 @@ name: 'Release' on: - schedule: - # Runs every day at midnight UTC for the nightly release. - - cron: '0 0 * * *' - # Runs every Tuesday at 23:59 UTC for the preview release. - - cron: '59 23 * * 2' workflow_dispatch: inputs: version: - description: 'The version to release (e.g., v0.1.11). Required for manual patch releases.' - required: false # Not required for scheduled runs + description: 'The version to release (e.g., v0.1.11).' + required: true type: 'string' ref: description: 'The branch or ref (full git sha) to release from.' @@ -22,16 +17,6 @@ on: required: true type: 'boolean' default: true - create_nightly_release: - description: 'Auto apply the nightly release tag, input version is ignored.' - required: false - type: 'boolean' - default: false - create_preview_release: - description: 'Auto apply the preview release tag, input version is ignored.' - required: false - type: 'boolean' - default: false force_skip_tests: description: 'Select to skip the "Run Tests" step in testing. Prod releases should run tests' required: false @@ -63,25 +48,9 @@ jobs: - name: 'Set booleans for simplified logic' env: - CREATE_NIGHTLY_RELEASE: '${{ github.event.inputs.create_nightly_release }}' - CREATE_PREVIEW_RELEASE: '${{ github.event.inputs.create_preview_release }}' - EVENT_NAME: '${{ github.event_name }}' - CRON: '${{ github.event.schedule }}' DRY_RUN_INPUT: '${{ github.event.inputs.dry_run }}' id: 'vars' run: |- - is_nightly="false" - if [[ "${CRON}" == "0 0 * * *" || "${CREATE_NIGHTLY_RELEASE}" == "true" ]]; then - is_nightly="true" - fi - echo "is_nightly=${is_nightly}" >> "${GITHUB_OUTPUT}" - - is_preview="false" - if [[ "${CRON}" == "59 23 * * 2" || "${CREATE_PREVIEW_RELEASE}" == "true" ]]; then - is_preview="true" - fi - echo "is_preview=${is_preview}" >> "${GITHUB_OUTPUT}" - is_dry_run="false" if [[ "${DRY_RUN_INPUT}" == "true" ]]; then is_dry_run="true" @@ -100,17 +69,16 @@ jobs: - name: 'Get the version' id: 'version' - env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - IS_NIGHTLY: '${{ steps.vars.outputs.is_nightly }}' - IS_PREVIEW: '${{ steps.vars.outputs.is_preview }}' - MANUAL_VERSION: '${{ inputs.version }}' run: |- - VERSION_JSON="$(node scripts/get-release-version.js)" - echo "RELEASE_TAG=$(echo "${VERSION_JSON}" | jq -r .releaseTag)" >> "${GITHUB_OUTPUT}" - echo "RELEASE_VERSION=$(echo "${VERSION_JSON}" | jq -r .releaseVersion)" >> "${GITHUB_OUTPUT}" - echo "NPM_TAG=$(echo "${VERSION_JSON}" | jq -r .npmTag)" >> "${GITHUB_OUTPUT}" - echo "PREVIOUS_TAG=$(echo "${VERSION_JSON}" | jq -r .previousReleaseTag)" >> "${GITHUB_OUTPUT}" + RELEASE_TAG="${{ inputs.version }}" + # The version for npm should not have the 'v' prefix. + RELEASE_VERSION="${RELEASE_TAG#v}" + NPM_TAG="latest" + PREVIOUS_TAG=$(git describe --tags --abbrev=0) + echo "RELEASE_TAG=${RELEASE_TAG}" >> "${GITHUB_OUTPUT}" + echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "${GITHUB_OUTPUT}" + echo "NPM_TAG=${NPM_TAG}" >> "${GITHUB_OUTPUT}" + echo "PREVIOUS_TAG=${PREVIOUS_TAG}" >> "${GITHUB_OUTPUT}" - name: 'Run Tests' if: |-