-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release workflow step to rebuild JSON schemas
- Loading branch information
1 parent
60d3744
commit 64a4023
Showing
1 changed file
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|