1/2c. Bump versions for extension only (promotes patch branch to stable release) #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 1/2c. Bump versions for extension only (promotes patch branch to stable release) | |
# This workflow covers both '1_check_for_updates' and '2_bump_versions' workflows, therefore it is another variant of the same, but specifically for extension only, without any Prisma CLI updates that would need to be handled. | |
# This is used to manually promote the patch branch to stable and release a new stable version. | |
on: | |
workflow_dispatch: | |
env: | |
ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
PRISMA_TELEMETRY_INFORMATION: 'language-tools 1_2_c_promote_patch_to_stable.yml' | |
jobs: | |
bump: | |
runs-on: ubuntu-latest | |
timeout-minutes: 7 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PRISMA_BOT_TOKEN }} | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm install && npm run bootstrap | |
- name: Checkout main | |
run: git fetch && git checkout main | |
- name: Setup Git | |
run: | | |
sh scripts/set_git_credentials.sh | |
- name: Update extension version in scripts folder | |
id: update | |
run: node scripts/bump_extension_version.js "latest" | |
- name: Commit and Push | |
run: | | |
sh scripts/commit_and_push.sh "[skip ci] bump extension version in scripts to ${{ steps.update.outputs.next_extension_version }}." | |
- name: Switch branch | |
id: setup_branch | |
run: | | |
sh scripts/setup_branch.sh "promote_patch-dev" | |
- name: Update VS Code extension version | |
run: | | |
node scripts/update_package_json_files.js latest ${{ steps.update.outputs.next_extension_version }} "" | |
- name: Install Dependencies | |
run: npm install && npm run bootstrap | |
- name: Commit and Push | |
run: | | |
sh scripts/commit_and_push.sh "[skip ci] bump extension version in package.json to ${{ steps.update.outputs.next_extension_version }}." | |
- name: Trigger next workflow for Language Server tests | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: 3. Test Language Server and publish | |
token: ${{ secrets.PRISMA_BOT_TOKEN }} | |
inputs: '{ "npm_channel": "latest", "extension_version": "${{ steps.update.outputs.next_extension_version }}", "branch": "stable", "trigger_reason": "Manual trigger promoting patch branch to stable" }' | |
- name: 'Set current job url in SLACK_FOOTER env var' | |
if: ${{ failure() }} | |
run: echo "SLACK_FOOTER=<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|Click here to go to the job logs>" >> $GITHUB_ENV | |
- name: Slack Notification on Failure | |
if: ${{ failure() }} | |
uses: rtCamp/[email protected] | |
env: | |
SLACK_TITLE: '1/2c. - Promoting patch branch to stable failed :x:' | |
SLACK_COLOR: '#FF0000' | |
SLACK_MESSAGE: '${{ steps.update.outputs.next_extension_version }} - On manual trigger promoting patch branch to stable.' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_FAILURES }} | |
SLACK_CHANNEL: feed-language-tools-failures | |
SLACK_USERNAME: Prismo | |
SLACK_ICON_EMOJI: ':boom:' | |
SLACK_MSG_AUTHOR: prisma-bot |