Skip to content

Commit

Permalink
fix build pr check
Browse files Browse the repository at this point in the history
Signed-off-by: Valeriy Svydenko <[email protected]>
  • Loading branch information
svor committed May 2, 2024
1 parent 7e44562 commit b6e9e97
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
38 changes: 38 additions & 0 deletions .ci/extension_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
#
# Copyright (c) 2024 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# This script is used to check for updates to the Visual Studio plugins listed in plugin-config.json.

set -ex

echo "Checking for updates to the Visual Studio plugins listed in plugin-config.json"

MAIN_BRANCH="devspaces-3-rhel-8"
curl -sSLo plugin-config-main.json https://raw.githubusercontent.com/redhat-developer/devspaces-vscode-extensions/$MAIN_BRANCH/plugin-config.json

pluginsConfig=$(jq -r '.Plugins | keys[]' <plugin-config.json)
pluginsConfigMain=$(jq -r '.Plugins | keys[]' <plugin-config-main.json)

for plugin in $pluginsConfig; do
# If it is a new extension and doesn't exist in the main branch, try to build it
if [[ ! " ${pluginsConfigMain[*]} " =~ $plugin ]]; then
echo "New extension found: $plugin"
echo "Building $plugin"
./build/build.sh "$plugin" --clean
continue
fi
# If it is an existing extension, check if the revision has changed
revision=$(jq -r --arg plugin "$plugin" '.Plugins[$plugin].revision' <plugin-config.json)
revisionMain=$(jq -r --arg plugin "$plugin" '.Plugins[$plugin].revision' <plugin-config-main.json)
if [[ "${revision}" != "${revisionMain}" ]]; then
echo "Revision changed for $plugin"
echo "Building $plugin"
./build/build.sh "$plugin" --clean
fi
done
7 changes: 3 additions & 4 deletions .github/workflows/extension-pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
# SPDX-License-Identifier: EPL-2.0
#

name: Extension Build
name: Updated Extensions Build
on:
pull_request:
paths:
- '**/extension.json'
- '**/Dockerfile'
- 'plugin-config.json'

jobs:
build-push:
Expand All @@ -27,7 +26,7 @@ jobs:

- name: Build extension
run: |
./.ci/extension_build_publish.sh build-publish origin/${{ github.base_ref }} ${{ github.event.pull_request.head.sha }}
./.ci/extension_build.sh
- name: Upload artifacts
Expand Down
5 changes: 3 additions & 2 deletions plugin-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
},
"redhat.fabric8-analytics": {
"repository": "https://github.com/fabric8-analytics/fabric8-analytics-vscode-extension",
"revision": "v0.9.4",
"revision": "v0.9.2",
"update": "true",
"packageManager": "[email protected]"
},
Expand Down Expand Up @@ -193,8 +193,9 @@
"update": "true"
},
"redhat.vscode-quarkus": {
"comment": "Version: 1.17.0",
"repository": "https://github.com/redhat-developer/vscode-quarkus",
"revision": "v1.29.0",
"revision": "c225c2f85d8f680a8de335bb294013d27f1e7b51",
"update": "true"
},
"redhat.vscode-redhat-account": {
Expand Down

0 comments on commit b6e9e97

Please sign in to comment.