69 lines
2.3 KiB
YAML
69 lines
2.3 KiB
YAML
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: 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
|
|
- id: tools-team-slack
|
|
uses: slackapi/slack-github-action@v1.26
|
|
env:
|
|
SLACK_BOT_TOKEN: ${{ secrets.VMWARE_SLACK_BOT_TOKEN }}
|
|
with:
|
|
channel-id: "C0188MENU2J"
|
|
payload: |
|
|
{
|
|
"text": "Published release `$VSIX_FILE`",
|
|
"blocks": [
|
|
{
|
|
"type": "section",
|
|
"text": {
|
|
"type": "mrkdwn",
|
|
"text": "Release is now available on VSCode Marketplace: <https://marketplace.visualstudio.com/items?itemName=vmware.${{ inputs.extension-name }}|${{ inputs.extension-name }}>"
|
|
}
|
|
}
|
|
]
|
|
}
|