diff --git a/.github/workflows/publish_package.yml b/.github/workflows/publish_package.yml index ebcbda9..89ce99a 100644 --- a/.github/workflows/publish_package.yml +++ b/.github/workflows/publish_package.yml @@ -8,6 +8,8 @@ jobs: build-n-publish: name: Build and publish Python distributions to PyPI runs-on: ubuntu-latest + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - uses: actions/checkout@v3 @@ -16,8 +18,8 @@ jobs: with: python-version: '3.10' - - name: Install build dependencies - run: python -m pip install --upgrade pip build + - name: Install build and tomlkit dependencies + run: python -m pip install --upgrade pip build tomlkit - name: Extract version from tag id: get_version @@ -25,7 +27,7 @@ jobs: - name: Update version in pyproject.toml run: | - python -c "import toml; pyproj = toml.load('pyproject.toml'); pyproj['project']['version'] = '${{ env.VERSION }}'; toml.dump(pyproj, open('pyproject.toml', 'w'))" + python -c "import tomlkit; with open('pyproject.toml', 'r') as file: pyproj = tomlkit.load(file); pyproj['project']['version'] = '${{ env.VERSION }}'; with open('pyproject.toml', 'w') as file: tomlkit.dump(pyproj, file)" - name: Build distribution run: python -m build --sdist --wheel --outdir dist/