From 81489921bd5719a329d5420705e9cbef1fa3df3d Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 21 Nov 2024 19:35:37 +0100 Subject: [PATCH] Preparatory steps to have https://gdal.org default to a 'stable' branch --- .github/workflows/auto_tag_stable.yml | 47 +++++++++++++++++++++++++++ HOWTO-RELEASE | 5 +++ doc/source/conf.py | 4 ++- doc/source/extra_path/robots.txt | 4 +++ 4 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/auto_tag_stable.yml create mode 100644 doc/source/extra_path/robots.txt diff --git a/.github/workflows/auto_tag_stable.yml b/.github/workflows/auto_tag_stable.yml new file mode 100644 index 000000000000..71f005635758 --- /dev/null +++ b/.github/workflows/auto_tag_stable.yml @@ -0,0 +1,47 @@ +name: Update Stable Tag + +on: + push: + branches: + - '**' # Matches all branches, but we later filter on the one matching the STABLE_BRANCH repository variable + +permissions: + contents: read + +jobs: + update-stable-tag: + runs-on: ubuntu-latest + if: github.repository == 'OSGeo/GDAL' + permissions: + contents: write + steps: + - name: Check branch match + id: check_branch + env: + STABLE_BRANCH: ${{ vars.STABLE_BRANCH }} # Repository variable + run: | + echo "Push detected on branch $GITHUB_REF" + if [[ "${GITHUB_REF#refs/heads/}" != "${STABLE_BRANCH}" ]]; then + echo "This workflow only runs for branch $STABLE_BRANCH. Skipping further steps." + echo "run=false" >> $GITHUB_OUTPUT + else + echo "run=true" >> $GITHUB_OUTPUT + fi + + - name: Checkout code + if: steps.check_branch.outputs.run == 'true' + uses: actions/checkout@v4 + + - name: Tag + if: steps.check_branch.outputs.run == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.email "GDAL-bot@example.com" + git config --global user.name "GDAL-bot" + touch .dummy-file + git add .dummy-file + # Do that so that stable doesn't have the same git sha as the stable branch, so ReadTheDocs triggers a build + git commit -a -m "Add .dummy-file" + git checkout -b stable + git push -f origin stable diff --git a/HOWTO-RELEASE b/HOWTO-RELEASE index 46c735f003b6..81b1bc871d17 100644 --- a/HOWTO-RELEASE +++ b/HOWTO-RELEASE @@ -152,6 +152,11 @@ Process : 15) Once the vote has positively completed, +15.0) For a new feature release, update the STABLE_BRANCH repository variable + + Go to https://github.com/OSGeo/GDAL/settings/variables/actions/STABLE_BRANCH + and update the value to be release/x.y + 15.1) Tag the release as final: git checkout v3.1.0RC1 diff --git a/doc/source/conf.py b/doc/source/conf.py index f3e323d38f13..96cc248c7eb2 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -160,7 +160,9 @@ # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] -html_extra_path = ["../build/html_extra"] + +# For generated content and robots.txt +html_extra_path = ["../build/html_extra", "extra_path"] html_js_files = ["announcement.js"] html_css_files = ["announcement.css"] diff --git a/doc/source/extra_path/robots.txt b/doc/source/extra_path/robots.txt new file mode 100644 index 000000000000..7eba37d690b6 --- /dev/null +++ b/doc/source/extra_path/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: /en/stable/ +Disallow: /en/ +Sitemap: https://gdal.org/sitemap.xml