From 51d4e7e6b843222d9728587d86b6293c3c382e16 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 1 Apr 2024 20:28:16 +0200 Subject: [PATCH] Reworked CI --- .github/workflows/ci.yml | 42 +++++++++++++++++++--------------------- requirements.build.txt | 2 ++ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a658cfb..5706ae8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,11 +39,16 @@ jobs: - run: python -m pip install -r requirements.txt - run: python test.py - tag: + tag_and_publish: runs-on: ubuntu-latest needs: test + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: - uses: actions/checkout@v4 + with: + fetch-tags: true - name: setup git run: | @@ -64,26 +69,19 @@ jobs: - name: Push Tag run: git push origin ${{ steps.git_version.outputs.version }} - publish: - needs: tag - runs-on: ubuntu-latest + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.build.txt - - - name: Build and publish - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.build.txt + python setup.py sdist bdist_wheel + - name: Build and publish + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/requirements.build.txt b/requirements.build.txt index 4a58714..403cf41 100644 --- a/requirements.build.txt +++ b/requirements.build.txt @@ -23,3 +23,5 @@ twine==5.0.0 urllib3==2.2.1 wheel==0.43.0 zipp==3.18.1 + +-r requirements.txt