Skip to content

Commit e23b2be

Browse files
committed
[GHA] GCP Backup upload working
1 parent 21fa3ef commit e23b2be

File tree

4 files changed

+35
-41
lines changed

4 files changed

+35
-41
lines changed

Diff for: .github/scripts/copy-from-s3-to-gcp.sh

-14
This file was deleted.

Diff for: .github/workflows/backup-eclipse-releases-to-gcp.yml

+15-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
required: true
99
type: string
1010
release_version:
11-
description: Release version (i.e. 4.20.1)
11+
description: Release version (i.e. 4.20.1.RELEASE)
1212
required: true
1313
type: string
1414

@@ -19,6 +19,7 @@ env:
1919
AWS_ENDPOINT_URL_S3: ${{ secrets.CDN_S3_ENDPOINT }}
2020
AWS_S3_BUCKET: ${{ secrets.CDN_BUCKET }}
2121
DOWNLOAD_URL_ROOT: https://cdn.spring.io/spring-tools
22+
GCP_BUCKET: gs://cdn-spring-io
2223

2324
jobs:
2425
backup-eclipse-releases-to-gcp:
@@ -27,23 +28,19 @@ jobs:
2728
steps:
2829
- name: Authenticate to GCP
2930
run: |
30-
echo -e "${{ secrets.CDN_SPRING_IO_BACKUP_GCP_BUCKET_JSON }} " > ~/gcp.json
31-
gcloud auth activate-service-account --key-file=~/gcp.json
32-
- uses: actions/checkout@v4
33-
with:
34-
sparse-checkout: |
35-
.github/scripts
36-
- name: Download from S3, Upload to GCP
31+
echo '${{ secrets.CDN_SPRING_IO_BACKUP_GCP_BUCKET_JSON }}' > ./gcp.json
32+
gcloud auth activate-service-account --key-file=./gcp.json
33+
rm -f gcp.json
34+
- name: Copy from S3 to GCP
3735
run: |
36+
echo "Copying Eclipse LS extensions ${{ inputs.ls_version }} to GCP..."
3837
url_path=spring-tools/release/TOOLS/sts4-language-server-integrations/${{ inputs.ls_version }}
39-
40-
echo "Copying Eclipse LS extensions ${{ inputs.ls_version }} to GCP..."
41-
${{ github.workspace }}/.github/scripts/copy-from-s3-to-gcp.sh s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path
38+
gcloud storage cp s3://$AWS_S3_BUCKET/$url_path $GCP_BUCKET/$url_path --recursive
4239
43-
echo "Copying Eclipse Distro P2 repos ${{ inputs.ls_version }} to GCP..."
44-
url_path=spring-tools/release/TOOLS/sts4/update/${{ inputs.release_version }}.RELEASE
45-
${{ github.workspace }}/.github/scripts/copy-from-s3-to-gcp.sh s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path
46-
47-
echo "Copying Eclipse Distros ${{ inputs.release_version }} to GCP..."
48-
url_path=spring-tools/release/STS4/${{ inputs.release_version }}.RELEASE/dist
49-
${{ github.workspace }}/.github/scripts/copy-from-s3-to-gcp.sh s3://$AWS_S3_BUCKET/$url_path gs://gcp-test-spring-io/$url_path
40+
echo "Copying Eclipse Distro P2 repos ${{ inputs.release_version }} to GCP..."
41+
url_path=spring-tools/release/TOOLS/sts4/update/${{ inputs.release_version }}
42+
gcloud storage cp s3://$AWS_S3_BUCKET/$url_path $GCP_BUCKET/$url_path --recursive
43+
44+
echo "Copying Eclipse Distros ${{ inputs.release_version }} to GCP..."
45+
url_path=spring-tools/release/STS4/${{ inputs.release_version }}/dist
46+
gcloud storage cp s3://$AWS_S3_BUCKET/$url_path $GCP_BUCKET/$url_path --recursive

Diff for: .github/workflows/publish-eclipse-release.yml

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ jobs:
3838
latest: ${{ inputs.eclipse_latest }}
3939
secrets: inherit
4040

41+
backup-release-on-gcp:
42+
uses: ./.github/workflows/backup-eclipse-releases-to-gcp.yml
43+
with:
44+
ls_version: ${{ inputs.ls_version }}
45+
release_version: ${{ inputs.release_version }}.RELEASE
46+
4147
# create-github-release:
4248
# uses: ./.github/workflows/create-gh-release.yml
4349
# with:

Diff for: .github/workflows/publish-vscode-extension.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,36 @@ on:
1717
type: string
1818

1919
env:
20-
DOWNLOAD_URL_ROOT: https://cdn.spring.io/spring-tools
20+
DOWNLOAD_URL_ROOT: https://cdn.spring.io
21+
VSIX_FILE: ${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix
22+
URL_PATH: spring-tools/release/vscode-extensions/${{ inputs.extension-name }}/${{ inputs.version }}
23+
GCP_BUCKET: gs://cdn-spring-io
2124

2225
jobs:
23-
2426
publish-release:
2527
runs-on: ubuntu-latest
2628
name: Publish '${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix'
2729
steps:
2830
- name: Download Release VSIX
2931
id: download-release
3032
run: |
31-
vsix_file=${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix
32-
wget $DOWNLOAD_URL_ROOT/release/vscode-extensions/${{ inputs.extension-name }}/${{ inputs.version }}/$vsix_file
33+
wget $DOWNLOAD_URL_ROOT/$URL_PATH/$VSIX_FILE
3334
- name: Publish to VSCode Marketplace
3435
id: publish-vsce
3536
run: |
3637
npm install --global @vscode/vsce
37-
vsix_file=${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix
38-
vsce publish -p ${{ secrets.VSCE_PUBLISH_TOKEN }} --packagePath $vsix_file
38+
vsce publish -p ${{ secrets.VSCE_PUBLISH_TOKEN }} --packagePath $VSIX_FILE
3939
- name: Publish to Eclipse Open VSX
4040
id: publish-ovsx
4141
run: |
4242
npm install --global ovsx
43-
vsix_file=${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix
44-
ovsx publish -p ${{ secrets.OVSX_PUBLISH_TOKEN }} $vsix_file
43+
ovsx publish -p ${{ secrets.OVSX_PUBLISH_TOKEN }} $VSIX_FILE
44+
- name: Upload to GCP
45+
run: |
46+
echo '${{ secrets.CDN_SPRING_IO_BACKUP_GCP_BUCKET_JSON }}' > ./gcp.json
47+
gcloud auth activate-service-account --key-file=./gcp.json
48+
rm -f gcp.json
49+
gcloud storage cp $VSIX_FILE $GCP_BUCKET/$URL_PATH/$VSIX_FILE
4550
- id: tools-team-slack
4651
uses: slackapi/[email protected]
4752
env:
@@ -50,7 +55,7 @@ jobs:
5055
channel-id: "C0188MENU2J"
5156
payload: |
5257
{
53-
"text": "Published release `${{ inputs.extension-name }}-${{ inputs.version }}-${{ inputs.postfix }}.vsix`",
58+
"text": "Published release `$VSIX_FILE`",
5459
"blocks": [
5560
{
5661
"type": "section",

0 commit comments

Comments
 (0)