Skip to content

Commit

Permalink
Feat: Update fetch-docs script on major release with a tag
Browse files Browse the repository at this point in the history
  • Loading branch information
WilsonZiweiWang committed Mar 5, 2024
1 parent 3780fb3 commit 162a86c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update required extension version
name: Update references for commits, tags, etc

on:
workflow_dispatch:
Expand Down Expand Up @@ -34,19 +34,23 @@ 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'
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
title: Auto update references for commits, tags, etc
commit-message: Auto update references for commits, tags, etc
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 5 additions & 3 deletions scripts/fetch-docs.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
32 changes: 32 additions & 0 deletions scripts/update-fetch-docs-commits.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 162a86c

Please sign in to comment.