Skip to content

Commit 02c764a

Browse files
committed
Use pypi trust provider to upload assets
Use pypi trust provider to upload assets Signed-off-by: Frank Li <Frank.Li@nxp.com>
1 parent 4f4977b commit 02c764a

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/build_wrapper.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ jobs:
135135

136136
build-libuuu-wrapper:
137137
runs-on: ubuntu-latest
138+
permissions:
139+
id-token: write # Required for trusted publishing
140+
contents: read # Required for actions/checkout
138141
needs: create-universal-dylib
139142
steps:
140143
- name: Checkout uuu repository
@@ -177,16 +180,13 @@ jobs:
177180
name: reports
178181
path: ./wrapper/reports/*
179182

180-
- name: Release package to pypi
183+
- name: Publish to PyPI
184+
uses: pypa/gh-action-pypi-publish@release/v1
181185
if: github.ref_type == 'tag'
182-
env:
183-
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
184-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
185-
#TWINE_REPOSITORY_URL: ${{ secrets.TWINE_REPOSITORY_URL }}
186-
working-directory: ./wrapper
187-
run: |
188-
twine --no-color check dist/*
189-
twine --no-color upload --repository pypi dist/*
186+
with:
187+
# This tells the action to use Trusted Publishing with OIDC
188+
skip-existing: true # Optional: don’t fail if the same version is already uploaded
189+
packages-dir: ./wrapper/dist
190190

191191
- name: Upload the dist folder
192192
uses: actions/upload-artifact@v4

wrapper/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ libuuu = ["*.dll", "*.so", "*.dylib"]
3535
root = ".."
3636
version_file = "libuuu/__version__.py"
3737
tag_regex = "^(?P<prefix>uuu_)?(?P<version>\\d+(\\.\\d+)*)$"
38+
local_scheme = "no-local-version"
3839

3940
[tool.setuptools.dynamic]
4041
dependencies = {file = ["requirements.txt"]}

0 commit comments

Comments
 (0)