-
-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
root: generate python client (#9107)
* generate api client Signed-off-by: Jens Langhammer <jens@goauthentik.io> # Conflicts: # authentik/lib/expression/evaluator.py # poetry.lock * don't attempt to pr upgrade api client Signed-off-by: Jens Langhammer <jens@goauthentik.io> # Conflicts: # poetry.lock # pyproject.toml * use new generator Signed-off-by: Jens Langhammer <jens@goauthentik.io> * t Signed-off-by: Jens Langhammer <jens@goauthentik.io> * use upstream generator since that one is v2 already 🤦 Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add missing help to makefile Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
- Loading branch information
Showing
7 changed files
with
240 additions
and
1,713 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: authentik-api-py-publish | ||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "schema.yml" | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- id: generate_token | ||
uses: tibdex/github-app-token@v2 | ||
with: | ||
app_id: ${{ secrets.GH_APP_ID }} | ||
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.generate_token.outputs.token }} | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
cache: "poetry" | ||
- name: Generate API Client | ||
run: make gen-client-py | ||
- name: Publish package | ||
working-directory: gen-py-api/ | ||
run: | | ||
poetry build | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: gen-py-api/dist/ | ||
# We can't easily upgrade the API client being used due to poetry being poetry | ||
# so we'll have to rely on dependabot | ||
# - name: Upgrade / | ||
# run: | | ||
# export VERSION=$(cd gen-py-api && poetry version -s) | ||
# poetry add "authentik_client=$VERSION" --allow-prereleases --lock | ||
# - uses: peter-evans/create-pull-request@v6 | ||
# id: cpr | ||
# with: | ||
# token: ${{ steps.generate_token.outputs.token }} | ||
# branch: update-root-api-client | ||
# commit-message: "root: bump API Client version" | ||
# title: "root: bump API Client version" | ||
# body: "root: bump API Client version" | ||
# delete-branch: true | ||
# signoff: true | ||
# # ID from https://api.github.com/users/authentik-automation[bot] | ||
# author: authentik-automation[bot] <135050075+authentik-automation[bot]@users.noreply.github.com> | ||
# - uses: peter-evans/enable-pull-request-automerge@v3 | ||
# with: | ||
# token: ${{ steps.generate_token.outputs.token }} | ||
# pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
# merge-method: squash |
2 changes: 1 addition & 1 deletion
2
.github/workflows/web-api-publish.yml → .github/workflows/api-ts-publish.yml
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: authentik-web-api-publish | ||
name: authentik-api-ts-publish | ||
on: | ||
push: | ||
branches: [main] | ||
|
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
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
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
Oops, something went wrong.