Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "3.12"
- name: Install tox
run: |
python -m pip install --upgrade pip
Expand All @@ -65,6 +65,9 @@ jobs:
# in the BO4E-Schemas repo. For this we have to retrieve the commits SHA via the API first.
# For this, we use the lightweight tool jq (https://stedolan.github.io/jq/) to parse the JSON
# response from the API.
- name: Install dependencies for creating release
run: |
pip install requests click
- name: Tag and release the new version in BO4E-Schemas
run: python bo4e_schemas_create_release.py
env:
Expand All @@ -83,12 +86,17 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
pip install -r requirements.txt
# Note: The sphinx action below can only install a single requirements file.
- name: Build JSON Schemas
run: tox -e generate_json_schemas
env:
TARGET_VERSION: ${{ github.ref_name }}
- name: Run kroki with docker
run: |
docker compose up -d
Expand All @@ -105,14 +113,16 @@ jobs:
env:
SPHINX_DOCS_RELEASE: ${{ github.ref_name }}
SPHINX_DOCS_VERSION: ${{ github.ref_name }}
- id: latest_bo4e
name: Get latest BO4E release tag
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Export LATEST_TAG
run: |
echo "LATEST_TAG=$(curl -qsSL \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"${{ github.api_url }}/repos/${{ github.repository }}/releases/latest" \
| jq -r .tag_name)" >> $GITHUB_ENV
- name: Redirect stable to new release if the new release is marked as latest
if: steps.latest_bo4e.outputs.release == github.ref_name
if: ${{ env.LATEST_TAG == github.ref_name }}
run: |
echo "Redirecting stable to new version ${{ github.ref_name }}"
rm -rf stable
Expand Down