Skip to content

Commit b776f70

Browse files
committed
Use pypi trust provider to upload assets
Use pypi trust provider to upload assets. Fix#481 Wrong version on aarch64 binary. Signed-off-by: Frank Li <Frank.Li@nxp.com>
1 parent 4f4977b commit b776f70

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/build_arm.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
fetch-depth: 0
3232
submodules: true
3333

34+
- name: git fetch tags
35+
run: |
36+
git fetch --tags --force # Retrieve annotated tags. #issue 290
37+
3438
- uses: uraimo/run-on-arch-action@v2
3539
name: Build artifact
3640
id: build

.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)