[GHA] GCP Backup upload working

This commit is contained in:
aboyko
2024-07-16 13:28:54 -04:00
parent 21fa3ef658
commit e23b2be87b
4 changed files with 35 additions and 41 deletions

View File

@@ -17,10 +17,12 @@ on:
type: string
env:
DOWNLOAD_URL_ROOT: https://cdn.spring.io/spring-tools
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'
@@ -28,20 +30,23 @@ jobs:
- name: Download Release VSIX
id: download-release
run: |
vsix_file=${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix
wget $DOWNLOAD_URL_ROOT/release/vscode-extensions/${{ inputs.extension-name }}/${{ inputs.version }}/$vsix_file
wget $DOWNLOAD_URL_ROOT/$URL_PATH/$VSIX_FILE
- name: Publish to VSCode Marketplace
id: publish-vsce
run: |
npm install --global @vscode/vsce
vsix_file=${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix
vsce publish -p ${{ secrets.VSCE_PUBLISH_TOKEN }} --packagePath $vsix_file
vsce publish -p ${{ secrets.VSCE_PUBLISH_TOKEN }} --packagePath $VSIX_FILE
- name: Publish to Eclipse Open VSX
id: publish-ovsx
run: |
npm install --global ovsx
vsix_file=${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix
ovsx publish -p ${{ secrets.OVSX_PUBLISH_TOKEN }} $vsix_file
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:
@@ -50,7 +55,7 @@ jobs:
channel-id: "C0188MENU2J"
payload: |
{
"text": "Published release `${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix`",
"text": "Published release `$VSIX_FILE`",
"blocks": [
{
"type": "section",