Skip to content

Commit 0710384

Browse files
committed
added trusted publishing infos
1 parent a328767 commit 0710384

2 files changed

Lines changed: 47 additions & 19 deletions

File tree

.github/workflows/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,30 @@ jobs:
6262
- name: Run pyright
6363
run: |
6464
pyright
65+
66+
create_wheel_and_sdist:
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- uses: actions/checkout@v3
71+
72+
- name: Set up Python
73+
uses: actions/setup-python@v4
74+
with:
75+
python-version: '3.13'
76+
architecture: x64
77+
78+
- name: Install dependencies
79+
run: |
80+
python -m pip install --upgrade pip
81+
pip install wheel build
82+
83+
- name: Build wheel and sdist
84+
run: |
85+
python -m build
86+
87+
- name: Upload wheel and sdist as artifact
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: Package-Distributions-construct-typing
91+
path: dist/
Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
41
name: Upload Python Package
52

63
on:
74
release:
85
types: [created]
96

107
jobs:
11-
deploy:
8+
create_wheel_and_sdist:
9+
name: create_wheel_and_sdist
10+
uses: ./.github/workflows/main.yml
11+
with:
12+
attest-package: "true"
1213

14+
deploy:
15+
depends-on: create_wheel_and_sdist
1316
runs-on: ubuntu-latest
17+
18+
environment: pypi
19+
permissions:
20+
id-token: write. # IMPORTANT: this permission is mandatory for Trusted Publishing
1421

1522
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python
18-
uses: actions/setup-python@v2
23+
- uses: actions/checkout@v3
24+
25+
- name: Download artifacts
26+
uses: actions/download-artifact@v4
1927
with:
20-
python-version: '3.x'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel build twine
25-
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29-
run: |
30-
python -m build --wheel --sdist
31-
twine upload dist/*
28+
name: Package-Distributions-construct-typing
29+
path: ./dist
30+
31+
- name: Publish package distributions to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)