Skip to content

Commit

Permalink
Add release workflow step to rebuild JSON schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
lord-haffi committed Oct 9, 2023
1 parent 60d3744 commit 64a4023
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,36 @@ jobs:
- name: Run the Tests
run: |
tox -e tests
generate:
name: Generate JSON-Schemas
runs-on: ubuntu-latest
needs: tests
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Build JSON Schemas
run: tox -e generate_json_schemas
- name: Push schemas to BO4E-Schemas repo
uses: cpina/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.BO4E_PYTHON_GENERATE_SCHEMAS }} # this token expires on 2024-10-09
# token with repo scope
# https://github.com/Hochfrequenz/BO4E-python/settings/secrets/actions/BO4E_PYTHON_GENERATE_SCHEMAS
with:
source-directory: "json_schemas"
target-directory: "src/bo4e_schemas"
destination-github-username: "Hochfrequenz"
destination-repository-name: "BO4E-Schemas"
user-email: [email protected]
target-branch: main
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
Expand All @@ -38,7 +67,7 @@ jobs:
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
needs: tests
needs: [tests, generate]
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand Down

0 comments on commit 64a4023

Please sign in to comment.