Skip to content

Commit 91d1933

Browse files
committed
[GHA] Fix VSIX builds uploads/deletes
1 parent dbd9dcb commit 91d1933

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
id=$1
22
label=$2
33
download_url_root=$3
4+
version=$4
45

5-
vsix_file=`aws s3 ls s3://$AWS_S3_BUCKET/snapshot/vscode-extensions/$id/ | awk '{$1=$2=$3=""; print $0}' | awk '{$1=$1};1' | grep "\.vsix$"`
6+
vsix_file=`aws s3 ls s3://$AWS_S3_BUCKET/snapshot/vscode-extensions/$id/ | awk '{$1=$2=$3=""; print $0}' | awk '{$1=$1};1' | grep "${id}-${version}.*\.vsix$"`
67
if [ ! -z "${vsix_file}" ]; then
78
echo "<li>${label}: <a href=\"${download_url_root}/snapshot/vscode-extensions/${id}/${vsix_file}\">${vsix_file}</a></li>"
89
fi

.github/workflows/build-vscode-extension.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
echo "VSIX file to upload ${vsix_file}"
5656
s3_path=${{ inputs.dist }}/vscode-extensions/${{ inputs.extension-name }}/$base_version
5757
echo "S3 path: ${s3_path}"
58-
aws s3 rm s3://$AWS_S3_BUCKET/$s3_path/ --recursive
58+
aws s3 rm s3://$AWS_S3_BUCKET/$s3_path/ --recursive --exclude "*" --include "${{ inputs.extension-name }}-${base_version}*.vsix"
5959
aws s3 cp ./vsix/$vsix_file s3://$AWS_S3_BUCKET/$s3_path/$vsix_file --no-progress
6060
echo "version=$base_version" >> $GITHUB_OUTPUT
6161
echo "s3_url=${DOWNLOAD_URL_ROOT}/$s3_path/$vsix_file" >> $GITHUB_OUTPUT

.github/workflows/release-vscode-extension.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
echo "VSIX file to upload ${vsix_file}"
7575
s3_path=release/vscode-extensions/${{ inputs.extension-name }}/${{ steps.version.outputs.version }}
7676
echo "S3 path: ${s3_path}"
77-
aws s3 rm s3://$AWS_S3_BUCKET/$s3_path/ --recursive
77+
aws s3 rm s3://$AWS_S3_BUCKET/$s3_path/ --recursive --exclude "*" --include "${{ inputs.extension-name }}-${{ steps.version.outputs.version }}*.vsix"
7878
aws s3 cp ./vsix/$vsix_file s3://$AWS_S3_BUCKET/$s3_path/${{ steps.version.outputs.release_name }}.vsix --no-progress --checksum-algorithm CRC32
7979
echo "s3_url=${DOWNLOAD_URL_ROOT}/$s3_path/${{ steps.version.outputs.release_name }}.vsix" >> $GITHUB_OUTPUT
8080
# - id: tools-team-slack

.github/workflows/snapshot-vscode-extension.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ jobs:
3737
- uses: actions/setup-node@v4
3838
with:
3939
node-version: 22
40+
- name: version
41+
run: |
42+
cd ${{ github.workspace }}/vscode-extensions/${{ inputs.extension-name }
43+
version=$(npm pkg get version)
44+
cd ${{ github.workspace }}
45+
echo $version
46+
echo "version=$version" >> $GITHUB_OUTPUT
4047
- name: Build .VSIX file
4148
id: build-vsix
4249
env:
@@ -51,17 +58,17 @@ jobs:
5158
echo "VSIX file to upload ${vsix_file}"
5259
s3_path=snapshot/vscode-extensions/${{ inputs.extension-name }}
5360
echo "S3 path: ${s3_path}"
54-
aws s3 rm s3://$AWS_S3_BUCKET/$s3_path/ --recursive
61+
aws s3 rm s3://$AWS_S3_BUCKET/$s3_path/ --recursive --exclude "*" --include "${{ inputs.extension-name }}-${{ steps.version.outputs.version }}*.vsix"
5562
aws s3 cp ./vsix/$vsix_file s3://$AWS_S3_BUCKET/$s3_path/$vsix_file --no-progress --checksum-algorithm CRC32
5663
- name: Update Nightly Builds download page
5764
run: |
5865
downloads_html="vscode-extensions-snippet.html"
5966
echo '<ul>' >> $downloads_html
60-
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-spring-boot "Spring Boot Tools" $DOWNLOAD_URL_ROOT` >> $downloads_html
61-
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-concourse "Concourse Editor" $DOWNLOAD_URL_ROOT` >> $downloads_html
62-
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-bosh "Bosh Editor" $DOWNLOAD_URL_ROOT` >> $downloads_html
63-
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-manifest-yaml "CF Manifest Editor" $DOWNLOAD_URL_ROOT` >> $downloads_html
64-
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-spring-cli "Spring CLI" $DOWNLOAD_URL_ROOT` >> $downloads_html
67+
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-spring-boot "Spring Boot Tools" $DOWNLOAD_URL_ROOT ${{ steps.version.outputs.version }}` >> $downloads_html
68+
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-concourse "Concourse Editor" $DOWNLOAD_URL_ROOT ${{ steps.version.outputs.version }}` >> $downloads_html
69+
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-bosh "Bosh Editor" $DOWNLOAD_URL_ROOT ${{ steps.version.outputs.version }}` >> $downloads_html
70+
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-manifest-yaml "CF Manifest Editor" $DOWNLOAD_URL_ROOT ${{ steps.version.outputs.version }}` >> $downloads_html
71+
echo `${{ github.workspace }}/.github/scripts/gen-vscode-link-bullet.sh vscode-spring-cli "Spring CLI" $DOWNLOAD_URL_ROOT ${{ steps.version.outputs.version }}` >> $downloads_html
6572
echo '</ul>' >> $downloads_html
6673
cat ./$downloads_html
6774
aws s3 mv ./$downloads_html s3://$AWS_S3_BUCKET/snapshot/vscode-extensions/ --no-progress --checksum-algorithm CRC32

0 commit comments

Comments
 (0)