name: Publish VSCode Extension on: workflow_dispatch: inputs: extension-name: description: name of the extension, e.g. vscode-spring-cli required: true type: string version: description: version of the extension required: true type: string postfix: description: For example "RC1" required: true type: string env: DOWNLOAD_URL_ROOT: https://cdn.spring.io VSIX_FILE: ${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix URL_PATH: spring-tools/release/vscode-extensions/${{ inputs.extension-name }}/${{ inputs.version }} GCP_BUCKET: gs://cdn-spring-io jobs: publish-release: runs-on: ubuntu-latest name: Publish '${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix' steps: - name: Use Node.js 22.x uses: actions/setup-node@v3 with: node-version: 22.x - name: Download Release VSIX id: download-release run: | wget $DOWNLOAD_URL_ROOT/$URL_PATH/$VSIX_FILE - name: Publish to VSCode Marketplace id: publish-vsce run: | npm install --global @vscode/vsce vsce publish -p ${{ secrets.VSCE_PUBLISH_TOKEN }} --packagePath $VSIX_FILE - name: Publish to Eclipse Open VSX id: publish-ovsx run: | npm install --global ovsx ovsx publish -p ${{ secrets.OVSX_PUBLISH_TOKEN }} $VSIX_FILE - name: Upload to GCP run: | echo '${{ secrets.CDN_SPRING_IO_BACKUP_GCP_BUCKET_JSON }}' > ./gcp.json gcloud auth activate-service-account --key-file=./gcp.json rm -f gcp.json gcloud storage cp $VSIX_FILE $GCP_BUCKET/$URL_PATH/$VSIX_FILE - name: GChat spring-tools-team notification run: | curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \ --header 'Content-Type: application/json' \ --data-raw "{ \"cards\": [ { \"header\": { \"title\": \"Published `${VSIX_FILE}`\", \"imageUrl\": \"https://code.visualstudio.com/assets/images/code-stable.png\", }, \"sections\": [ { \"widgets\": [ { \"keyValue\": { \"topLabel\": \"VSCode Marketplace\", \"content\": \"${VSIX_FILE}\", \"contentMultiline\": true } }, { \"keyValue\": { \"topLabel\": \"Open VSX Registry\", \"content\": \"${VSIX_FILE}\", \"contentMultiline\": true } } ] } ] } ] }"