From 9e46da22769a6742e4abf57d117bff5ddb156c8d Mon Sep 17 00:00:00 2001 From: Lucas Hardt Date: Sun, 19 Oct 2025 13:29:00 +0200 Subject: [PATCH 1/9] Rework docs workflow --- .github/workflows/docs.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 827def21..e0f5ebd6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,5 @@ # This workflow builds the Sphinx documentation, and in doing so - checks for errors in the documentation. -name: Docs +name: docs on: push: @@ -12,25 +12,20 @@ permissions: jobs: docs: - name: Test Docs + name: test docs runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v5 - + - uses: actions/checkout@v5 - name: Setup Python 3.10 uses: actions/setup-python@v6 with: python-version: "3.10" cache: "pip" # Cache the pip packages to speed up the workflow - + - name: Set up UV + uses: astral-sh/setup-uv@v6 - name: Install Dependencies and Package - run: | - python -m pip install -U pip setuptools - pip install -U -r requirements.txt - pip install -e .[docs] - + run: uv sync --extra docs - name: Build Documentation run: | cd docs From 51705ba7e6fbb2d68adc426dab414320d1d8145b Mon Sep 17 00:00:00 2001 From: Lucas Hardt Date: Sun, 19 Oct 2025 13:34:57 +0200 Subject: [PATCH 2/9] Fix docs workflow --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e0f5ebd6..01780141 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -29,4 +29,4 @@ jobs: - name: Build Documentation run: | cd docs - sphinx-build -b html -j auto -a -n -T -W --keep-going . _build/html \ No newline at end of file + uv run sphinx-build -b html -j auto -a -n -T -W --keep-going . _build/html \ No newline at end of file From 90adf4276ccb6bacc30bea9e95feb91cb0e9ac3b Mon Sep 17 00:00:00 2001 From: Lucas Hardt Date: Sun, 19 Oct 2025 13:39:15 +0200 Subject: [PATCH 3/9] Remove uncessary permissions from ruff workflow --- .github/workflows/lint.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1184f019..79803d04 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,8 +10,7 @@ permissions: jobs: ruff: - permissions: - contents: read + name: ruff linter runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 From 99e87fb0c5536e7e042f0573dbd77cb89c042c9c Mon Sep 17 00:00:00 2001 From: Lucas Hardt Date: Sun, 19 Oct 2025 13:43:38 +0200 Subject: [PATCH 4/9] rework test workflow --- .github/workflows/test.yml | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8900867..8cccacd9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ # This workflow will ensure that the pushed contents to the repo # are not majorly breaking. -name: Pytests +name: test on: push: @@ -14,27 +14,24 @@ permissions: jobs: pytest: - name: Pytest runs-on: ubuntu-latest - + strategy: + fail-fast: false + matrix: + python-version: [ '3.10', '3.x' ] + name: pytest ${{ matrix.python-version }} steps: - - name: Checkout - uses: actions/checkout@v5 - - - name: Setup Python 3.10 + - uses: actions/checkout@v5 + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: - python-version: "3.10" + python-version: ${{ matrix.python-version }} cache: "pip" # Cache the pip packages to speed up the workflow - + - name: Set up UV + uses: astral-sh/setup-uv@v6 - name: Install Dependencies and Package - run: | - python -m pip install -U pip setuptools - pip install -U -r requirements.txt - pip install -e .[tests] - + run: uv sync --extra tests - name: Run Pytest Checks - shell: bash env: TEST_API_KEY: ${{ secrets.TEST_API_KEY }} - run: python -m pytest --cov=fortnite_api --import-mode=importlib -vs tests/ \ No newline at end of file + run: uv run pytest --cov=fortnite_api --import-mode=importlib -vs tests/ \ No newline at end of file From cc8e95c44dee8dc5bf23645aed8454a4eea19709 Mon Sep 17 00:00:00 2001 From: Lucas Hardt Date: Sun, 19 Oct 2025 13:56:46 +0200 Subject: [PATCH 5/9] Rework release workflow --- .github/workflows/pypi.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 5f799a70..d26f0211 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,4 +1,4 @@ -name: PyPI Release +name: pipy release on: release: @@ -17,19 +17,14 @@ jobs: permissions: id-token: write steps: - - name: Checkout - uses: actions/checkout@v5 - + - uses: actions/checkout@v5 - name: Setup Python 3.10 uses: actions/setup-python@v6 with: python-version: "3.10" - - - name: Install Dependencies - run: python -m pip install -U pip setuptools build - - - name: Build Project - run: python -m build - - - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + - name: Set up UV + uses: astral-sh/setup-uv@v6 + - name: Build + run: uv build + - name: Publish + run: uv publish From 4c4c5de12561810bf0204fb3fad6dd4fa5ad12a0 Mon Sep 17 00:00:00 2001 From: Lucas Hardt Date: Wed, 29 Oct 2025 12:10:30 +0100 Subject: [PATCH 6/9] merge docs and pypi workflow into build --- .github/workflows/build.yml | 57 +++++++++++++++++++++++++++++++++++++ .github/workflows/docs.yml | 32 --------------------- .github/workflows/pypi.yml | 30 ------------------- 3 files changed, 57 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..dabeeacb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,57 @@ +# This workflow builds the Sphinx documentation, and in doing so - checks for errors in the documentation. +name: build + +on: + push: + pull_request: + types: [ opened, reopened, synchronize ] + release: + types: [ published ] + workflow_dispatch: + +permissions: + contents: read + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - name: Setup Python 3.10 + uses: actions/setup-python@v6 + with: + python-version: "3.10" + - name: Setup UV + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + - name: Install dependencies + run: uv sync --extra docs + - name: Build documentation + run: | + cd docs + uv run sphinx-build -b html -j auto -a -n -T -W --keep-going . _build/html + dist: + runs-on: ubuntu-latest + permissions: + id-token: write + environment: + name: pypi + url: https://pypi.org/p/fortnite-api + steps: + - uses: actions/checkout@v5 + - name: Setup Python 3.10 + uses: actions/setup-python@v6 + with: + python-version: "3.10" + - name: Setup UV + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + - name: Install dependencies + run: uv sync + - name: Build distributions + run: uv build + - name: Publish distributions + if: github.event_name == 'release' + run: uv publish \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 01780141..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow builds the Sphinx documentation, and in doing so - checks for errors in the documentation. -name: docs - -on: - push: - pull_request: - types: [ opened, reopened, synchronize ] - workflow_dispatch: - -permissions: - contents: read - -jobs: - docs: - name: test docs - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v5 - - name: Setup Python 3.10 - uses: actions/setup-python@v6 - with: - python-version: "3.10" - cache: "pip" # Cache the pip packages to speed up the workflow - - name: Set up UV - uses: astral-sh/setup-uv@v6 - - name: Install Dependencies and Package - run: uv sync --extra docs - - name: Build Documentation - run: | - cd docs - uv run sphinx-build -b html -j auto -a -n -T -W --keep-going . _build/html \ No newline at end of file diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml deleted file mode 100644 index d26f0211..00000000 --- a/.github/workflows/pypi.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: pipy release - -on: - release: - types: [ published ] - workflow_dispatch: - -permissions: - contents: read - -jobs: - pypi: - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/fortnite-api - permissions: - id-token: write - steps: - - uses: actions/checkout@v5 - - name: Setup Python 3.10 - uses: actions/setup-python@v6 - with: - python-version: "3.10" - - name: Set up UV - uses: astral-sh/setup-uv@v6 - - name: Build - run: uv build - - name: Publish - run: uv publish From e30468708b0bae71db45256dd7f313bf3d94d864 Mon Sep 17 00:00:00 2001 From: Lucas Hardt Date: Wed, 29 Oct 2025 12:11:04 +0100 Subject: [PATCH 7/9] enable cache and improve naming --- .github/workflows/lint.yml | 8 ++++---- .github/workflows/test.yml | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 79803d04..5b5e2948 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,15 +10,15 @@ permissions: jobs: ruff: - name: ruff linter runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - name: Get Ruff Version + - name: Get Ruff version id: ruff-version run: echo "version=$(grep -Po '(?<=ruff==)[0-9]+\.[0-9]+\.[0-9]+' pyproject.toml)" >> $GITHUB_OUTPUT - - - uses: astral-sh/ruff-action@v3 + + - name: Run Ruff linter + uses: astral-sh/ruff-action@v3 with: version: ${{ steps.ruff-version.outputs.version }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cccacd9..40c7327c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,8 @@ jobs: cache: "pip" # Cache the pip packages to speed up the workflow - name: Set up UV uses: astral-sh/setup-uv@v6 + with: + enable-cache: true - name: Install Dependencies and Package run: uv sync --extra tests - name: Run Pytest Checks From 92d8173f68b6eb16d849156ea33a9b26c03f72b8 Mon Sep 17 00:00:00 2001 From: Lucas Hardt Date: Wed, 29 Oct 2025 13:27:09 +0100 Subject: [PATCH 8/9] split dist in dist and dist-release --- .github/workflows/build.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dabeeacb..064ce640 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,23 @@ jobs: cd docs uv run sphinx-build -b html -j auto -a -n -T -W --keep-going . _build/html dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - name: Setup Python 3.10 + uses: actions/setup-python@v6 + with: + python-version: "3.10" + - name: Setup UV + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + - name: Install dependencies + run: uv sync + - name: Build distributions + run: uv build + dist-release: + if: github.event_name == 'release' runs-on: ubuntu-latest permissions: id-token: write @@ -53,5 +70,4 @@ jobs: - name: Build distributions run: uv build - name: Publish distributions - if: github.event_name == 'release' run: uv publish \ No newline at end of file From 738d1befe1f9980cf4ce7f544207f29336513d8b Mon Sep 17 00:00:00 2001 From: Lucas Hardt Date: Fri, 31 Oct 2025 18:39:30 +0100 Subject: [PATCH 9/9] seperate publishing action in seperated release workflow --- .github/workflows/build.yml | 27 +-------------------------- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 064ce640..879f3aa9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,3 @@ -# This workflow builds the Sphinx documentation, and in doing so - checks for errors in the documentation. name: build on: @@ -46,28 +45,4 @@ jobs: - name: Install dependencies run: uv sync - name: Build distributions - run: uv build - dist-release: - if: github.event_name == 'release' - runs-on: ubuntu-latest - permissions: - id-token: write - environment: - name: pypi - url: https://pypi.org/p/fortnite-api - steps: - - uses: actions/checkout@v5 - - name: Setup Python 3.10 - uses: actions/setup-python@v6 - with: - python-version: "3.10" - - name: Setup UV - uses: astral-sh/setup-uv@v6 - with: - enable-cache: true - - name: Install dependencies - run: uv sync - - name: Build distributions - run: uv build - - name: Publish distributions - run: uv publish \ No newline at end of file + run: uv build \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c1a4722c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: release + +on: + release: + types: [ published ] + workflow_dispatch: + +permissions: + contents: read + +jobs: + dist: + if: github.event_name == 'release' + runs-on: ubuntu-latest + permissions: + id-token: write + environment: + name: pypi + url: https://pypi.org/p/fortnite-api + steps: + - uses: actions/checkout@v5 + - name: Setup Python 3.10 + uses: actions/setup-python@v6 + with: + python-version: "3.10" + - name: Setup UV + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + - name: Install dependencies + run: uv sync + - name: Build distributions + run: uv build + - name: Publish distributions + run: uv publish \ No newline at end of file