From 74fa642c4127b8c5ee4f00ee3eb23d7363ca8bf3 Mon Sep 17 00:00:00 2001 From: Robin Wimmers Date: Thu, 10 Oct 2024 11:58:33 +0200 Subject: [PATCH] ci: add docs deploy job and release job --- .github/workflows/deploy_docs.yaml | 60 +++++++++++++++------------- .github/workflows/lint_test.yaml | 30 +++++++------- .github/workflows/release_pypi.yaml | 62 +++++++++++++++-------------- 3 files changed, 80 insertions(+), 72 deletions(-) diff --git a/.github/workflows/deploy_docs.yaml b/.github/workflows/deploy_docs.yaml index 72db26f..097a5b7 100644 --- a/.github/workflows/deploy_docs.yaml +++ b/.github/workflows/deploy_docs.yaml @@ -1,33 +1,39 @@ -# name: deploy docs +name: deploy docs -# on: -# push: -# branches: -# - main +on: + push: + branches: + - main -# jobs: -# deploy_docs: -# name: Deploy docs -# runs-on: ubuntu-20.04 -# steps: -# - uses: actions/checkout@v3 +permissions: read-all -# - name: Install python 3.9 -# uses: actions/setup-python@v4 -# with: -# python-version: 3.9 +jobs: + deploy_docs: + name: Deploy docs + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 -# - name: Install dependencies -# run: | -# python -m pip install --upgrade pip setuptools -# pip install -r requirements.txt -# pip install . + - name: Install python 3.12 + uses: actions/setup-python@v4 + with: + python-version: "3.12" -# - name: Build docs -# run: sphinx-build -b html docs public + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + pip install -r requirements.txt + pip install . -# - name: Publish docs -# uses: peaceiris/actions-gh-pages@v3 -# with: -# github_token: ${{ secrets.GITHUB_TOKEN }} -# publish_dir: ./public \ No newline at end of file + - name: Build docs + run: sphinx-build -b html docs public + env: + NUCLEI_TOKEN: ${{ secrets.NUCLEI_TOKEN }} + BASETIME_ACCESS_KEY: ${{ secrets.BASETIME_ACCESS_KEY }} + BASETIME_KEY_ID: ${{ secrets.BASETIME_KEY_ID }} + + - name: Publish docs + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public diff --git a/.github/workflows/lint_test.yaml b/.github/workflows/lint_test.yaml index 7dd8c44..45673d5 100644 --- a/.github/workflows/lint_test.yaml +++ b/.github/workflows/lint_test.yaml @@ -45,21 +45,21 @@ jobs: BASETIME_ACCESS_KEY: ${{ secrets.BASETIME_ACCESS_KEY }} BASETIME_KEY_ID: ${{ secrets.BASETIME_KEY_ID }} - # - name: Post coverage results - # uses: coverallsapp/github-action@v2 - # with: - # flag-name: run-${{ matrix.python-version }} - # parallel: true - - # finish: - # needs: test - # if: ${{ always() }} - # runs-on: ubuntu-latest - # steps: - # - name: Coveralls Finished - # uses: coverallsapp/github-action@v2 - # with: - # parallel-finished: true + - name: Post coverage results + uses: coverallsapp/github-action@v2 + with: + flag-name: run-${{ matrix.python-version }} + parallel: true + + finish: + needs: test + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + parallel-finished: true lint: name: Formatting check diff --git a/.github/workflows/release_pypi.yaml b/.github/workflows/release_pypi.yaml index 451fb1c..0da6dcf 100644 --- a/.github/workflows/release_pypi.yaml +++ b/.github/workflows/release_pypi.yaml @@ -1,39 +1,41 @@ -# name: Release +name: Release -# on: -# push: -# tags: ['*'] +on: + push: + tags: ["*"] -# jobs: -# deploy: -# runs-on: ubuntu-latest +permissions: read-all -# environment: -# name: release +jobs: + deploy: + runs-on: ubuntu-latest -# # Mandatory permission for trusted publishing to PyPi -# permissions: -# id-token: write + environment: + name: release -# steps: -# - uses: actions/checkout@v3 -# - name: Set up Python -# uses: actions/setup-python@v4 -# with: -# python-version: "3.11" + # Mandatory permission for trusted publishing to PyPi + permissions: + id-token: write -# - name: Install dependencies -# run: | -# pip install setuptools build + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" -# - name: Build a binary wheel and a source tarball -# run: python3 -m build + - name: Install dependencies + run: | + pip install setuptools build -# - name: Store the distribution packages -# uses: actions/upload-artifact@v3 -# with: -# name: python-package-distributions -# path: dist/ + - name: Build a binary wheel and a source tarball + run: python3 -m build -# - name: Publish distribution 📦 to PyPI -# uses: pypa/gh-action-pypi-publish@release/v1 + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1