Ensure cli using latest version from the supported_cli_versions.json (#1992)
This commit is contained in:
6
.github/workflows/bump-cli.yml
vendored
6
.github/workflows/bump-cli.yml
vendored
@@ -45,10 +45,10 @@ jobs:
|
|||||||
- name: Prepend another version
|
- name: Prepend another version
|
||||||
if: ${{ inputs.option == 'prepend' }}
|
if: ${{ inputs.option == 'prepend' }}
|
||||||
run: |
|
run: |
|
||||||
cat supported_cli_versions.json | jq '. |= ["${{ inputs.version }}"] + .' > supported_cli_versions_temp.json
|
cat extensions/ql-vscode/supported_cli_versions.json | jq '. |= ["${{ inputs.version }}"] + .' > supported_cli_versions_temp.json
|
||||||
mv supported_cli_versions_temp.json supported_cli_versions.json
|
mv supported_cli_versions_temp.json extensions/ql-vscode/supported_cli_versions.json
|
||||||
echo "LATEST_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
echo "LATEST_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
||||||
echo "PREVIOUS_VERSION=`jq -r '.[1]' supported_cli_versions.json`" >> $GITHUB_ENV
|
echo "PREVIOUS_VERSION=`jq -r '.[1]' extensions/ql-vscode/supported_cli_versions.json`" >> $GITHUB_ENV
|
||||||
- name: Commit, Push and Open a PR
|
- name: Commit, Push and Open a PR
|
||||||
uses: ./.github/actions/create-pr
|
uses: ./.github/actions/create-pr
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -191,7 +191,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Set the variables
|
- name: Set the variables
|
||||||
id: set-variables
|
id: set-variables
|
||||||
run: echo "cli-versions=$(cat ./supported_cli_versions.json | jq -rc)" >> $GITHUB_OUTPUT
|
run: echo "cli-versions=$(cat ./extensions/ql-vscode/supported_cli_versions.json | jq -rc)" >> $GITHUB_OUTPUT
|
||||||
outputs:
|
outputs:
|
||||||
cli-versions: ${{ steps.set-variables.outputs.cli-versions }}
|
cli-versions: ${{ steps.set-variables.outputs.cli-versions }}
|
||||||
cli-test:
|
cli-test:
|
||||||
|
|||||||
1
extensions/ql-vscode/supported_cli_versions.json
Normal file
1
extensions/ql-vscode/supported_cli_versions.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
["v2.11.6", "v2.7.6", "v2.8.5", "v2.9.4", "v2.10.5", "nightly"]
|
||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
codeQlLauncherName,
|
codeQlLauncherName,
|
||||||
} from "../../src/pure/distribution";
|
} from "../../src/pure/distribution";
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
|
import supportedCliVersions from "../../supported_cli_versions.json";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module ensures that the proper CLI is available for tests of the extension.
|
* This module ensures that the proper CLI is available for tests of the extension.
|
||||||
@@ -36,9 +37,9 @@ import fetch from "node-fetch";
|
|||||||
const _1MB = 1024 * 1024;
|
const _1MB = 1024 * 1024;
|
||||||
const _10MB = _1MB * 10;
|
const _10MB = _1MB * 10;
|
||||||
|
|
||||||
// CLI version to test. Hard code the latest as default. And be sure
|
// CLI version to test. Use the latest supported version by default.
|
||||||
// to update the env if it is not otherwise set.
|
// And be sure to update the env if it is not otherwise set.
|
||||||
const CLI_VERSION = process.env.CLI_VERSION || "v2.11.6";
|
const CLI_VERSION = process.env.CLI_VERSION || supportedCliVersions[0];
|
||||||
process.env.CLI_VERSION = CLI_VERSION;
|
process.env.CLI_VERSION = CLI_VERSION;
|
||||||
|
|
||||||
// Base dir where CLIs will be downloaded into
|
// Base dir where CLIs will be downloaded into
|
||||||
|
|||||||
@@ -9,5 +9,4 @@ PREVIOUS_VERSION=$(echo $VERSIONS | awk '{ print $2 }')
|
|||||||
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
|
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
|
||||||
echo "PREVIOUS_VERSION=$PREVIOUS_VERSION" >> $GITHUB_ENV
|
echo "PREVIOUS_VERSION=$PREVIOUS_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
sed -i "s/$PREVIOUS_VERSION/$LATEST_VERSION/g" supported_cli_versions.json
|
sed -i "s/$PREVIOUS_VERSION/$LATEST_VERSION/g" extensions/ql-vscode/supported_cli_versions.json
|
||||||
sed -i "s/$PREVIOUS_VERSION/$LATEST_VERSION/g" extensions/ql-vscode/test/vscode-tests/ensureCli.ts
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
[
|
|
||||||
"v2.11.6",
|
|
||||||
"v2.7.6",
|
|
||||||
"v2.8.5",
|
|
||||||
"v2.9.4",
|
|
||||||
"v2.10.5",
|
|
||||||
"nightly"
|
|
||||||
]
|
|
||||||
Reference in New Issue
Block a user