4. Bump LS in VS Code extension - Commit from main #5111
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: 4. Bump LS in VSCode extension | |
run-name: 4. Bump LS in VS Code extension - ${{ inputs.trigger_reason }} | |
on: | |
workflow_dispatch: | |
inputs: | |
npm_channel: | |
description: 'Prisma CLI NPM Channel' | |
required: true | |
extension_version: | |
description: 'VS Code extension version' | |
required: true | |
branch: | |
description: 'Branch to run run this workflow on' | |
required: true | |
trigger_reason: | |
description: 'Information about what caused the publishing process in the first place.' | |
required: true | |
env: | |
ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
PRISMA_TELEMETRY_INFORMATION: 'language-tools 4_bump_LS_in_extension.yml' | |
jobs: | |
bump: | |
name: Bump LS in VS Code extension | |
runs-on: ubuntu-latest | |
timeout-minutes: 7 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
token: ${{ secrets.PRISMA_BOT_TOKEN }} | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Print inputs | |
run: | | |
echo ${{github.event.inputs.npm_channel}} | |
echo ${{github.event.inputs.extension_version}} | |
echo ${{github.event.inputs.branch}} | |
echo ${{github.event.inputs.trigger_reason}} | |
- name: Install Dependencies | |
run: npm install && npm run bootstrap | |
- name: Bump LS version in extension | |
run: | | |
node scripts/update_package_json_files.js ${{ github.event.inputs.extension_version }} | |
- name: Install Dependencies | |
run: npm install && npm run bootstrap | |
- name: Setup Git | |
run: | | |
sh scripts/set_git_credentials.sh | |
- name: Read package.json versions (enginesVersion) for the commit message | |
id: packagejson | |
run: | | |
PACKAGE_JSON_PATH="./packages/language-server/package.json" | |
echo $PACKAGE_JSON_PATH | |
ENGINES_VERSION=$(jq -r '.prisma.enginesVersion' ${PACKAGE_JSON_PATH}) | |
echo "engines=$ENGINES_VERSION" >> "$GITHUB_OUTPUT" | |
- name: Commit and push to branch | |
run: | | |
sh scripts/commit_and_push.sh "Bump LS to ${{ github.event.inputs.extension_version }} in VS Code. Engines: ${{ steps.packagejson.outputs.engines }}" | |
- name: Trigger next workflow for VS Code e2e tests | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: 5. Integration tests in VSCode folder with published LS | |
token: ${{ secrets.GH_TOKEN }} | |
inputs: '{ "npm_channel": "${{ github.event.inputs.npm_channel }}", "extension_version": "${{ github.event.inputs.extension_version }}", "branch": "${{ github.event.inputs.branch }}", "trigger_reason": "${{github.event.inputs.trigger_reason}}" }' | |
- 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: '4. Bumping LS in VSCode extension failed :x:' | |
SLACK_COLOR: '#FF0000' | |
SLACK_MESSAGE: '${{github.event.inputs.extension_version}} - ${{github.event.inputs.trigger_reason}} ' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_FAILURES }} | |
SLACK_CHANNEL: feed-language-tools-failures | |
SLACK_USERNAME: Prismo | |
SLACK_ICON_EMOJI: ':boom:' | |
SLACK_MSG_AUTHOR: prisma-bot |