From c0192f3da38cd4460eb751ff8e9bec22c8d7fe42 Mon Sep 17 00:00:00 2001 From: Brendan Date: Thu, 3 Oct 2024 18:06:59 +0200 Subject: [PATCH] Move versioning workflow to master --- .github/workflows/version.yml | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/version.yml diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 00000000..3ba9d0d0 --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,52 @@ + +--- +name: Versioning + +on: + repository_dispatch: + types: [ docs-updated ] + workflow_dispatch: + +jobs: + Versioning: + defaults: + run: + shell: bash -l {0} + + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + python-version: ["3.12"] + include: + - os: ubuntu-latest + label: linux-64 + + name: ${{ matrix.os }} - py${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: gh-pages + + - name: Run versioning script + id: check + run: | + python .scripts/version.py + continue-on-error: true + + - name: Adjust stable symbolic link + if: ${{ steps.check.outcome == 'success' }} + run: | + ln -sfn ${{ env.NEW_STABLE_VERSION }} stable + + - name: Commit and push changes + if: ${{ steps.check.outcome == 'success' }} + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Added version ${{ env.NEW_STABLE_VERSION }}" + git push