From 3a80535ebdb55e2bf41fae61989da396359e826e Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Mon, 4 Mar 2024 14:22:11 -0500 Subject: [PATCH 01/10] Chore: Always fetch the latest commit for docs --- scripts/fetch-docs.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/fetch-docs.sh b/scripts/fetch-docs.sh index aa795c55..b7d5a065 100644 --- a/scripts/fetch-docs.sh +++ b/scripts/fetch-docs.sh @@ -1,9 +1,7 @@ #!/bin/bash -BITBAKE_DOCS_COMMIT=595176d6be95a9c4718d3a40499d1eb576b535f5 BITBAKE_DOCS_LIST="bitbake-user-manual-metadata.rst bitbake-user-manual-ref-variables.rst" -YOCTO_DOCS_COMMIT=897d5017eae6b3af2d5d489fc4e0915d9ce21458 YOCTO_DOCS_LIST=" tasks.rst variables.rst" set -e @@ -14,7 +12,7 @@ git clone --depth 1 --filter=blob:none --sparse https://github.com/openembedded/ cd bitbake git sparse-checkout set doc/bitbake-user-manual/ git fetch origin -git checkout $BITBAKE_DOCS_COMMIT +git checkout HEAD cd doc/bitbake-user-manual/ mv $BITBAKE_DOCS_LIST ../../../client/resources/docs cd ../../../ @@ -25,7 +23,7 @@ git clone --depth 1 --filter=blob:none --sparse https://git.yoctoproject.org/yoc cd yocto-docs git sparse-checkout set documentation/ref-manual git fetch origin -git checkout $YOCTO_DOCS_COMMIT +git checkout HEAD cd documentation/ref-manual mv $YOCTO_DOCS_LIST ../../../client/resources/docs cd ../../../ From 5fc48a939ee78d49df03a493b872bfef758f17a6 Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Mon, 4 Mar 2024 15:41:10 -0500 Subject: [PATCH 02/10] Feat: Add script to update the required extension version --- integration-tests/src/runTest.ts | 5 +++-- integration-tests/src/utils/version.ts | 8 ++++++++ scripts/update-extension-version.sh | 28 ++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 integration-tests/src/utils/version.ts create mode 100644 scripts/update-extension-version.sh diff --git a/integration-tests/src/runTest.ts b/integration-tests/src/runTest.ts index a2ec5dde..05ac7cd7 100644 --- a/integration-tests/src/runTest.ts +++ b/integration-tests/src/runTest.ts @@ -10,6 +10,7 @@ import { resolveCliArgsFromVSCodeExecutablePath, runTests } from '@vscode/test-electron' +import { pythonVersion, bashVersion } from './utils/version' async function main (): Promise { try { @@ -20,8 +21,8 @@ async function main (): Promise { cliPath, [ ...args, - '--install-extension', 'mads-hartmann.bash-ide-vscode@1.39.0', - '--install-extension', 'ms-python.python@2023.20.0' + '--install-extension', `mads-hartmann.bash-ide-vscode@${bashVersion}`, + '--install-extension', `ms-python.python@${pythonVersion}` ], { encoding: 'utf-8', diff --git a/integration-tests/src/utils/version.ts b/integration-tests/src/utils/version.ts new file mode 100644 index 00000000..153ace0b --- /dev/null +++ b/integration-tests/src/utils/version.ts @@ -0,0 +1,8 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) 2023 Savoir-faire Linux. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +// Required extension versions +export const bashVersion = '1.39.0' +export const pythonVersion = '2024.2.1' diff --git a/scripts/update-extension-version.sh b/scripts/update-extension-version.sh new file mode 100644 index 00000000..b265e880 --- /dev/null +++ b/scripts/update-extension-version.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -e + +DEST="integration-tests/src/utils/version.ts" + +# Keep the header +TOTAL_LINES=$(wc -l < $DEST) +LINES_TO_KEEP=$(($TOTAL_LINES - 2)) +TMP="tmp.ts" +head -n $LINES_TO_KEEP $DEST > $TMP + +git clone --depth 1 --filter=blob:none --sparse https://github.com/bash-lsp/bash-language-server +cd bash-language-server +git fetch --tags +echo "export const bashVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^vscode-client-//")'" >> ../$TMP +cd .. +rm -rf bash-language-server + +git clone --depth 1 --filter=blob:none --sparse https://github.com/Microsoft/vscode-python +cd vscode-python +git fetch --tags +echo "export const pythonVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^v//")'" >> ../$TMP +cd .. +rm -rf vscode-python + +cp $TMP $DEST +rm $TMP \ No newline at end of file From c621097e147875d61bd24ff9ba0dc97de63c9e9a Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Mon, 4 Mar 2024 15:41:59 -0500 Subject: [PATCH 03/10] Feat: Add workflow to run the script to update the required extension version --- .../update-extension-version-ref.yml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/update-extension-version-ref.yml diff --git a/.github/workflows/update-extension-version-ref.yml b/.github/workflows/update-extension-version-ref.yml new file mode 100644 index 00000000..7823bc36 --- /dev/null +++ b/.github/workflows/update-extension-version-ref.yml @@ -0,0 +1,52 @@ +name: Update required extension version + +on: + workflow_dispatch: + schedule: + - cron: '0 0 1 * *' # Run on the first day of every month + +jobs: + build: + + runs-on: ubuntu-latest + + defaults: + run: + shell: bash + + env: + DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1001/bus + SHELL: /usr/bin/bash + + strategy: + matrix: + node-version: [20] + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Update required extension version + run: bash scripts/update-extension-version.sh + + - name: Verify file changes + uses: tj-actions/verify-changed-files@v17 + id: verify-changed-files + with: + files: | + integration-tests/src/utils/version.ts + + - name: Create pull request + if: steps.verify-changed-files.outputs.files_changed == 'true' + uses: peter-evans/create-pull-request@v5 + with: + add-paths: | + integration-tests/src/utils/version.ts + title: Auto update required extension version + commit-message: Auto update required extension version + token: ${{ secrets.GITHUB_TOKEN }} From 3780fb3f1e9092c1603c13003e43679ec063eed3 Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Tue, 5 Mar 2024 09:43:21 -0500 Subject: [PATCH 04/10] Revert "Chore: Always fetch the latest commit for docs" This reverts commit 3a80535ebdb55e2bf41fae61989da396359e826e. --- scripts/fetch-docs.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-docs.sh b/scripts/fetch-docs.sh index b7d5a065..aa795c55 100644 --- a/scripts/fetch-docs.sh +++ b/scripts/fetch-docs.sh @@ -1,7 +1,9 @@ #!/bin/bash +BITBAKE_DOCS_COMMIT=595176d6be95a9c4718d3a40499d1eb576b535f5 BITBAKE_DOCS_LIST="bitbake-user-manual-metadata.rst bitbake-user-manual-ref-variables.rst" +YOCTO_DOCS_COMMIT=897d5017eae6b3af2d5d489fc4e0915d9ce21458 YOCTO_DOCS_LIST=" tasks.rst variables.rst" set -e @@ -12,7 +14,7 @@ git clone --depth 1 --filter=blob:none --sparse https://github.com/openembedded/ cd bitbake git sparse-checkout set doc/bitbake-user-manual/ git fetch origin -git checkout HEAD +git checkout $BITBAKE_DOCS_COMMIT cd doc/bitbake-user-manual/ mv $BITBAKE_DOCS_LIST ../../../client/resources/docs cd ../../../ @@ -23,7 +25,7 @@ git clone --depth 1 --filter=blob:none --sparse https://git.yoctoproject.org/yoc cd yocto-docs git sparse-checkout set documentation/ref-manual git fetch origin -git checkout HEAD +git checkout $YOCTO_DOCS_COMMIT cd documentation/ref-manual mv $YOCTO_DOCS_LIST ../../../client/resources/docs cd ../../../ From 162a86c52e674990877d437ebd32af5a1f7ef185 Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Tue, 5 Mar 2024 10:57:58 -0500 Subject: [PATCH 05/10] Feat: Update fetch-docs script on major release with a tag --- ...tension-version-ref.yml => update-ref.yml} | 10 ++++-- scripts/fetch-docs.sh | 8 +++-- scripts/update-fetch-docs-commits.sh | 32 +++++++++++++++++++ 3 files changed, 44 insertions(+), 6 deletions(-) rename .github/workflows/{update-extension-version-ref.yml => update-ref.yml} (78%) create mode 100644 scripts/update-fetch-docs-commits.sh diff --git a/.github/workflows/update-extension-version-ref.yml b/.github/workflows/update-ref.yml similarity index 78% rename from .github/workflows/update-extension-version-ref.yml rename to .github/workflows/update-ref.yml index 7823bc36..38ec22ec 100644 --- a/.github/workflows/update-extension-version-ref.yml +++ b/.github/workflows/update-ref.yml @@ -1,4 +1,4 @@ -name: Update required extension version +name: Update references for commits, tags, etc on: workflow_dispatch: @@ -34,12 +34,16 @@ jobs: - name: Update required extension version run: bash scripts/update-extension-version.sh + - name: Update fetch-docs script + run: bash scripts/update-fetch-docs-commits.sh + - name: Verify file changes uses: tj-actions/verify-changed-files@v17 id: verify-changed-files with: files: | integration-tests/src/utils/version.ts + scripts/fetch-docs.sh - name: Create pull request if: steps.verify-changed-files.outputs.files_changed == 'true' @@ -47,6 +51,6 @@ jobs: with: add-paths: | integration-tests/src/utils/version.ts - title: Auto update required extension version - commit-message: Auto update required extension version + title: Auto update references for commits, tags, etc + commit-message: Auto update references for commits, tags, etc token: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/fetch-docs.sh b/scripts/fetch-docs.sh index aa795c55..c89ccc5f 100644 --- a/scripts/fetch-docs.sh +++ b/scripts/fetch-docs.sh @@ -1,9 +1,11 @@ #!/bin/bash -BITBAKE_DOCS_COMMIT=595176d6be95a9c4718d3a40499d1eb576b535f5 -BITBAKE_DOCS_LIST="bitbake-user-manual-metadata.rst bitbake-user-manual-ref-variables.rst" +# Tag: yocto-4.3.3 +BITBAKE_DOCS_COMMIT=380a9ac97de5774378ded5e37d40b79b96761a0c +# Tag: yocto-4.3.3 +YOCTO_DOCS_COMMIT=dde4b815db82196af086847f68ee27d7902b4ffa -YOCTO_DOCS_COMMIT=897d5017eae6b3af2d5d489fc4e0915d9ce21458 +BITBAKE_DOCS_LIST="bitbake-user-manual-metadata.rst bitbake-user-manual-ref-variables.rst" YOCTO_DOCS_LIST=" tasks.rst variables.rst" set -e diff --git a/scripts/update-fetch-docs-commits.sh b/scripts/update-fetch-docs-commits.sh new file mode 100644 index 00000000..102cbd99 --- /dev/null +++ b/scripts/update-fetch-docs-commits.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +FILE="scripts/fetch-docs.sh" +TMP_FILE="tmp.txt" +tail -n +8 $FILE > $TMP_FILE + +echo "#!/bin/bash" > $FILE +echo "" >> $FILE + +git clone --depth 1 --filter=blob:none --sparse https://github.com/openembedded/bitbake.git +cd bitbake +git fetch --tags +TMP_TAG=$(git tag | tail -n 1) +LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") +echo "# Tag: $TMP_TAG" >> ../$FILE +echo "BITBAKE_DOCS_COMMIT=$LASTEST_RELEASE" >> ../$FILE +cd .. +rm -rf bitbake + +git clone --depth 1 --filter=blob:none --sparse https://git.yoctoproject.org/yocto-docs +cd yocto-docs +git fetch --tags +TMP_TAG=$(git tag | tail -n 1) +LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") +echo "# Tag: $TMP_TAG" >> ../$FILE +echo "YOCTO_DOCS_COMMIT=$LASTEST_RELEASE" >> ../$FILE +echo "" >> ../$FILE +cd .. +rm -rf yocto-docs + +cat $TMP_FILE >> $FILE +rm $TMP_FILE \ No newline at end of file From e1211576591f22584620b13a659f084ff56e3e5d Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Tue, 5 Mar 2024 16:19:01 -0500 Subject: [PATCH 06/10] Chore: Add fetch poky script --- package.json | 2 +- scripts/fetch-poky.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 scripts/fetch-poky.sh diff --git a/package.json b/package.json index c16e69b9..9a60bad7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "postinstall": "cd server && npm install && cd ../client && npm install", "fetch": "npm run fetch:poky && npm run fetch:docs", "fetch:docs": "sh scripts/fetch-docs.sh", - "fetch:poky": "mkdir -p resources/poky && curl -L -o resources/poky.tar.bz2 https://downloads.yoctoproject.org/releases/yocto/yocto-4.2.3/poky-aa63b25cbe25d89ab07ca11ee72c17cab68df8de.tar.bz2 && tar -xvjf resources/poky.tar.bz2 -C resources", + "fetch:poky": "sh scripts/fetch-poky.sh", "compile": "npm run installServer && tsc -b", "watch": "npm run installServer && tsc -b -w", "installServer": "cd server && npm run installServer", diff --git a/scripts/fetch-poky.sh b/scripts/fetch-poky.sh new file mode 100644 index 00000000..01a43d7a --- /dev/null +++ b/scripts/fetch-poky.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +git clone --depth 1 --filter=blob:none --sparse https://github.com/yoctoproject/poky.git +cd poky +git fetch --tags +TMP_TAG=$(git tag | grep "yocto-" | tail -n 1) # There is a tag: yocto_1.5_M5.rc8 which will take the tail, thus adding a hyphen +LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") +LINK="https://downloads.yoctoproject.org/releases/yocto/$TMP_TAG/poky-$LASTEST_RELEASE.tar.bz2" +cd .. +rm -rf poky + +mkdir -p resources/poky +curl -L -o resources/poky.tar.bz2 $LINK +tar -xvjf resources/poky.tar.bz2 -C resources \ No newline at end of file From e3b1445d09f063f1bd8d970a703bfdb8c0fa1784 Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Wed, 6 Mar 2024 10:29:11 -0500 Subject: [PATCH 07/10] Chore: Dicard tar and only use git to fetch --- scripts/fetch-poky.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/fetch-poky.sh b/scripts/fetch-poky.sh index 01a43d7a..111be160 100644 --- a/scripts/fetch-poky.sh +++ b/scripts/fetch-poky.sh @@ -2,15 +2,12 @@ set -e -git clone --depth 1 --filter=blob:none --sparse https://github.com/yoctoproject/poky.git -cd poky +mkdir -p resources/poky +cd resources/poky +git clone https://github.com/yoctoproject/poky.git . git fetch --tags TMP_TAG=$(git tag | grep "yocto-" | tail -n 1) # There is a tag: yocto_1.5_M5.rc8 which will take the tail, thus adding a hyphen LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") -LINK="https://downloads.yoctoproject.org/releases/yocto/$TMP_TAG/poky-$LASTEST_RELEASE.tar.bz2" -cd .. -rm -rf poky +git fetch origin +git checkout $LASTEST_RELEASE -mkdir -p resources/poky -curl -L -o resources/poky.tar.bz2 $LINK -tar -xvjf resources/poky.tar.bz2 -C resources \ No newline at end of file From 3970ce96f90e7b0442a25e97e667efbac2e0f005 Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Wed, 6 Mar 2024 10:36:53 -0500 Subject: [PATCH 08/10] Chore: Use variable for the paths --- .github/workflows/update-ref.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-ref.yml b/.github/workflows/update-ref.yml index 38ec22ec..3d0be211 100644 --- a/.github/workflows/update-ref.yml +++ b/.github/workflows/update-ref.yml @@ -17,6 +17,9 @@ jobs: env: DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1001/bus SHELL: /usr/bin/bash + FILE_PATHS: | + integration-tests/src/utils/version.ts + scripts/fetch-docs.sh strategy: matrix: @@ -41,16 +44,13 @@ jobs: uses: tj-actions/verify-changed-files@v17 id: verify-changed-files with: - files: | - integration-tests/src/utils/version.ts - scripts/fetch-docs.sh + files: ${{ env.FILE_PATHS }} - name: Create pull request if: steps.verify-changed-files.outputs.files_changed == 'true' uses: peter-evans/create-pull-request@v5 with: - add-paths: | - integration-tests/src/utils/version.ts + add-paths: ${{ env.FILE_PATHS }} title: Auto update references for commits, tags, etc commit-message: Auto update references for commits, tags, etc token: ${{ secrets.GITHUB_TOKEN }} From 801a4cfc7cef5a49f3769c32b58217ec3b47c1f4 Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Thu, 7 Mar 2024 11:20:52 -0500 Subject: [PATCH 09/10] Chore: Add script to update commit ref in fetch-poky script --- .github/workflows/update-ref.yml | 1 + scripts/fetch-poky.sh | 8 ++++---- scripts/update-fetch-poky-commit.sh | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 scripts/update-fetch-poky-commit.sh diff --git a/.github/workflows/update-ref.yml b/.github/workflows/update-ref.yml index 3d0be211..f83c2524 100644 --- a/.github/workflows/update-ref.yml +++ b/.github/workflows/update-ref.yml @@ -20,6 +20,7 @@ jobs: FILE_PATHS: | integration-tests/src/utils/version.ts scripts/fetch-docs.sh + scripts/fetch-poky.sh strategy: matrix: diff --git a/scripts/fetch-poky.sh b/scripts/fetch-poky.sh index 111be160..a77282d3 100644 --- a/scripts/fetch-poky.sh +++ b/scripts/fetch-poky.sh @@ -1,13 +1,13 @@ #!/bin/bash +# Tag: yocto-4.3.3 +COMMIT=d3b27346c3a4a7ef7ec517e9d339d22bda74349d + set -e mkdir -p resources/poky cd resources/poky git clone https://github.com/yoctoproject/poky.git . -git fetch --tags -TMP_TAG=$(git tag | grep "yocto-" | tail -n 1) # There is a tag: yocto_1.5_M5.rc8 which will take the tail, thus adding a hyphen -LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") git fetch origin -git checkout $LASTEST_RELEASE +git checkout $COMMIT diff --git a/scripts/update-fetch-poky-commit.sh b/scripts/update-fetch-poky-commit.sh new file mode 100644 index 00000000..3480fa75 --- /dev/null +++ b/scripts/update-fetch-poky-commit.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +FILE="scripts/fetch-poky.sh" +TMP_FILE="tmp.txt" +tail -n +6 $FILE > $TMP_FILE + +echo "#!/bin/bash" > $FILE +echo "" >> $FILE + +git clone --depth 1 --filter=blob:none --sparse https://github.com/yoctoproject/poky.git +cd poky +git fetch --tags +TMP_TAG=$(git tag | grep "yocto-" | tail -n 1) # There is a tag: yocto_1.5_M5.rc8 which will take the tail, thus adding a hyphen +LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") +echo "# Tag: $TMP_TAG" >> ../$FILE +echo "COMMIT=$LASTEST_RELEASE" >> ../$FILE +echo "" >> ../$FILE +cd .. +rm -rf poky + +cat $TMP_FILE >> $FILE +rm $TMP_FILE \ No newline at end of file From b0031220241671edcf50700ea57e6d21b9e89473 Mon Sep 17 00:00:00 2001 From: Ziwei Wang Date: Fri, 8 Mar 2024 08:28:57 -0500 Subject: [PATCH 10/10] Refactor: Move update scripts into one file --- .github/workflows/update-ref.yml | 5 +- scripts/update-extension-version.sh | 28 ---------- scripts/update-fetch-docs-commits.sh | 32 ----------- scripts/update-fetch-poky-commit.sh | 22 -------- scripts/update-ref.sh | 81 ++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+), 86 deletions(-) delete mode 100644 scripts/update-extension-version.sh delete mode 100644 scripts/update-fetch-docs-commits.sh delete mode 100644 scripts/update-fetch-poky-commit.sh create mode 100644 scripts/update-ref.sh diff --git a/.github/workflows/update-ref.yml b/.github/workflows/update-ref.yml index f83c2524..5212e2b6 100644 --- a/.github/workflows/update-ref.yml +++ b/.github/workflows/update-ref.yml @@ -36,10 +36,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Update required extension version - run: bash scripts/update-extension-version.sh - - - name: Update fetch-docs script - run: bash scripts/update-fetch-docs-commits.sh + run: bash scripts/update-ref.sh - name: Verify file changes uses: tj-actions/verify-changed-files@v17 diff --git a/scripts/update-extension-version.sh b/scripts/update-extension-version.sh deleted file mode 100644 index b265e880..00000000 --- a/scripts/update-extension-version.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -set -e - -DEST="integration-tests/src/utils/version.ts" - -# Keep the header -TOTAL_LINES=$(wc -l < $DEST) -LINES_TO_KEEP=$(($TOTAL_LINES - 2)) -TMP="tmp.ts" -head -n $LINES_TO_KEEP $DEST > $TMP - -git clone --depth 1 --filter=blob:none --sparse https://github.com/bash-lsp/bash-language-server -cd bash-language-server -git fetch --tags -echo "export const bashVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^vscode-client-//")'" >> ../$TMP -cd .. -rm -rf bash-language-server - -git clone --depth 1 --filter=blob:none --sparse https://github.com/Microsoft/vscode-python -cd vscode-python -git fetch --tags -echo "export const pythonVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^v//")'" >> ../$TMP -cd .. -rm -rf vscode-python - -cp $TMP $DEST -rm $TMP \ No newline at end of file diff --git a/scripts/update-fetch-docs-commits.sh b/scripts/update-fetch-docs-commits.sh deleted file mode 100644 index 102cbd99..00000000 --- a/scripts/update-fetch-docs-commits.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -FILE="scripts/fetch-docs.sh" -TMP_FILE="tmp.txt" -tail -n +8 $FILE > $TMP_FILE - -echo "#!/bin/bash" > $FILE -echo "" >> $FILE - -git clone --depth 1 --filter=blob:none --sparse https://github.com/openembedded/bitbake.git -cd bitbake -git fetch --tags -TMP_TAG=$(git tag | tail -n 1) -LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") -echo "# Tag: $TMP_TAG" >> ../$FILE -echo "BITBAKE_DOCS_COMMIT=$LASTEST_RELEASE" >> ../$FILE -cd .. -rm -rf bitbake - -git clone --depth 1 --filter=blob:none --sparse https://git.yoctoproject.org/yocto-docs -cd yocto-docs -git fetch --tags -TMP_TAG=$(git tag | tail -n 1) -LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") -echo "# Tag: $TMP_TAG" >> ../$FILE -echo "YOCTO_DOCS_COMMIT=$LASTEST_RELEASE" >> ../$FILE -echo "" >> ../$FILE -cd .. -rm -rf yocto-docs - -cat $TMP_FILE >> $FILE -rm $TMP_FILE \ No newline at end of file diff --git a/scripts/update-fetch-poky-commit.sh b/scripts/update-fetch-poky-commit.sh deleted file mode 100644 index 3480fa75..00000000 --- a/scripts/update-fetch-poky-commit.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -FILE="scripts/fetch-poky.sh" -TMP_FILE="tmp.txt" -tail -n +6 $FILE > $TMP_FILE - -echo "#!/bin/bash" > $FILE -echo "" >> $FILE - -git clone --depth 1 --filter=blob:none --sparse https://github.com/yoctoproject/poky.git -cd poky -git fetch --tags -TMP_TAG=$(git tag | grep "yocto-" | tail -n 1) # There is a tag: yocto_1.5_M5.rc8 which will take the tail, thus adding a hyphen -LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") -echo "# Tag: $TMP_TAG" >> ../$FILE -echo "COMMIT=$LASTEST_RELEASE" >> ../$FILE -echo "" >> ../$FILE -cd .. -rm -rf poky - -cat $TMP_FILE >> $FILE -rm $TMP_FILE \ No newline at end of file diff --git a/scripts/update-ref.sh b/scripts/update-ref.sh new file mode 100644 index 00000000..c0bfd165 --- /dev/null +++ b/scripts/update-ref.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +# Update the fetch-poky.sh script +FILE="scripts/fetch-poky.sh" +TMP_FILE="tmp.txt" +tail -n +6 $FILE > $TMP_FILE + +echo "#!/bin/bash" > $FILE +echo "" >> $FILE + +git clone --depth 1 --filter=blob:none --sparse https://github.com/yoctoproject/poky.git +cd poky +git fetch --tags +TMP_TAG=$(git tag | grep "yocto-" | tail -n 1) # There is a tag: yocto_1.5_M5.rc8 which will take the tail, thus adding a hyphen +LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") +echo "# Tag: $TMP_TAG" >> ../$FILE +echo "COMMIT=$LASTEST_RELEASE" >> ../$FILE +echo "" >> ../$FILE +cd .. +rm -rf poky + +cat $TMP_FILE >> $FILE +rm $TMP_FILE + +# Update the version.ts +DEST="integration-tests/src/utils/version.ts" + +# Keep the header +TOTAL_LINES=$(wc -l < $DEST) +LINES_TO_KEEP=$(($TOTAL_LINES - 2)) +TMP="tmp.ts" +head -n $LINES_TO_KEEP $DEST > $TMP + +git clone --depth 1 --filter=blob:none --sparse https://github.com/bash-lsp/bash-language-server +cd bash-language-server +git fetch --tags +echo "export const bashVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^vscode-client-//")'" >> ../$TMP +cd .. +rm -rf bash-language-server + +git clone --depth 1 --filter=blob:none --sparse https://github.com/Microsoft/vscode-python +cd vscode-python +git fetch --tags +echo "export const pythonVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^v//")'" >> ../$TMP +cd .. +rm -rf vscode-python + +cp $TMP $DEST +rm $TMP + +# Update the fetch-docs.sh script +FILE="scripts/fetch-docs.sh" +TMP_FILE="tmp.txt" +tail -n +8 $FILE > $TMP_FILE + +echo "#!/bin/bash" > $FILE +echo "" >> $FILE + +git clone --depth 1 --filter=blob:none --sparse https://github.com/openembedded/bitbake.git +cd bitbake +git fetch --tags +TMP_TAG=$(git tag | tail -n 1) +LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") +echo "# Tag: $TMP_TAG" >> ../$FILE +echo "BITBAKE_DOCS_COMMIT=$LASTEST_RELEASE" >> ../$FILE +cd .. +rm -rf bitbake + +git clone --depth 1 --filter=blob:none --sparse https://git.yoctoproject.org/yocto-docs +cd yocto-docs +git fetch --tags +TMP_TAG=$(git tag | tail -n 1) +LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") +echo "# Tag: $TMP_TAG" >> ../$FILE +echo "YOCTO_DOCS_COMMIT=$LASTEST_RELEASE" >> ../$FILE +echo "" >> ../$FILE +cd .. +rm -rf yocto-docs + +cat $TMP_FILE >> $FILE +rm $TMP_FILE \ No newline at end of file