From 9a2326f25c828bc1aa055f8da08f970a2eb798d4 Mon Sep 17 00:00:00 2001 From: James Kwon <96548424+hongil0316@users.noreply.github.com> Date: Wed, 1 May 2024 20:59:54 -0400 Subject: [PATCH] Update publish_package.yml --- .github/workflows/publish_package.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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/