Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit 95470a3

Browse files
authored
Merge pull request #1 from nathanw-mlc/pypi-trusted-publisher-implementation
TestPyPi trusted publisher implementation
2 parents 8bc7f13 + d0a3d8e commit 95470a3

File tree

3 files changed

+9
-154
lines changed

3 files changed

+9
-154
lines changed

.github/workflows/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ More Information on python-publish action & Repository Dispatch action can be fo
8989
### Secrets used
9090
| Name | |
9191
|---|---|
92-
|PYPI_USER |pypi login credentials used in GitHub workflows |
93-
|PYPI_PASSWORD |pypi login credentials used in GitHub workflows |
92+
|PYPI_USER (depreciated) |pypi login credentials used in GitHub workflows |
93+
|PYPI_PASSWORD (depreciated) |pypi login credentials used in GitHub workflows |
9494
|MLCOMMONS_REPO_ACCESS |public_repo ACL for request dispatch in GitHub workflows |

.github/workflows/python-publish.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
jobs:
1111
deploy:
1212
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
1315
steps:
1416
- uses: actions/checkout@v2
1517
- name: Set up Python
@@ -27,12 +29,10 @@ jobs:
2729
- name: Publish
2830
uses: pypa/gh-action-pypi-publish@release/v1
2931
with:
30-
user: ${{ secrets.PYPI_USER }}
3132
verify_metadata: true
3233
skip_existing: true
33-
password: ${{ secrets.PYPI_PASSWORD }}
3434
packages_dir: mlcube/dist/
35-
repository_url: https://upload.pypi.org/legacy/
35+
repository_url: https://test.pypi.org/legacy/
3636
verbose: true
3737
env:
3838
LOGLEVEL: DEBUG
@@ -45,5 +45,5 @@ jobs:
4545
uses: peter-evans/repository-dispatch@v1
4646
with:
4747
token: ${{ secrets.MLCOMMONS_REPO_ACCESS }}
48-
repository: mlcommons/mlcube
48+
repository: nathanw-mlc/mlcube
4949
event-type: publish-runners

.github/workflows/runner-publish.yml

+3-148
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,10 @@ on:
77
repository_dispatch:
88
types: publish-runners
99

10-
jobs:
11-
ssh_deploy:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v2
15-
- name: Set up Python
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: '3.x'
19-
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install setuptools wheel twine
23-
- name: Build distribution
24-
run: |
25-
cd runners/mlcube_ssh
26-
python setup.py sdist bdist_wheel
27-
- name: Publish
28-
uses: pypa/gh-action-pypi-publish@release/v1
29-
with:
30-
user: ${{ secrets.PYPI_USER }}
31-
verify_metadata: true
32-
skip_existing: true
33-
password: ${{ secrets.PYPI_PASSWORD }}
34-
packages_dir: runners/mlcube_ssh/dist/
35-
repository_url: https://upload.pypi.org/legacy/
36-
env:
37-
LOGLEVEL: DEBUG
38-
3910
docker_deploy:
4011
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write
4114
steps:
4215
- uses: actions/checkout@v2
4316
- name: Set up Python
@@ -55,128 +28,10 @@ jobs:
5528
- name: Publish
5629
uses: pypa/gh-action-pypi-publish@release/v1
5730
with:
58-
user: ${{ secrets.PYPI_USER }}
5931
verify_metadata: true
6032
skip_existing: true
61-
password: ${{ secrets.PYPI_PASSWORD }}
6233
packages_dir: runners/mlcube_docker/dist/
63-
repository_url: https://upload.pypi.org/legacy/
64-
verbose: true
65-
env:
66-
LOGLEVEL: DEBUG
67-
68-
singularity_deploy:
69-
runs-on: ubuntu-latest
70-
steps:
71-
- uses: actions/checkout@v2
72-
- name: Set up Python
73-
uses: actions/setup-python@v2
74-
with:
75-
python-version: '3.x'
76-
- name: Install dependencies
77-
run: |
78-
python -m pip install --upgrade pip
79-
pip install setuptools wheel twine
80-
- name: Build distribution
81-
run: |
82-
cd runners/mlcube_singularity
83-
python setup.py sdist bdist_wheel
84-
- name: Publish
85-
uses: pypa/gh-action-pypi-publish@release/v1
86-
with:
87-
user: ${{ secrets.PYPI_USER }}
88-
verify_metadata: true
89-
skip_existing: true
90-
password: ${{ secrets.PYPI_PASSWORD }}
91-
packages_dir: runners/mlcube_singularity/dist/
92-
repository_url: https://upload.pypi.org/legacy/
93-
verbose: true
94-
env:
95-
LOGLEVEL: DEBUG
96-
97-
kubernetes_runner_deploy:
98-
runs-on: ubuntu-latest
99-
steps:
100-
- uses: actions/checkout@v2
101-
- name: Set up Python
102-
uses: actions/setup-python@v2
103-
with:
104-
python-version: '3.x'
105-
- name: Install dependencies
106-
run: |
107-
python -m pip install --upgrade pip
108-
pip install setuptools wheel twine
109-
- name: Build distribution
110-
run: |
111-
cd runners/mlcube_k8s
112-
python setup.py sdist bdist_wheel
113-
- name: Publish
114-
uses: pypa/gh-action-pypi-publish@release/v1
115-
with:
116-
user: ${{ secrets.PYPI_USER }}
117-
verify_metadata: true
118-
skip_existing: true
119-
password: ${{ secrets.PYPI_PASSWORD }}
120-
packages_dir: runners/mlcube_k8s/dist/
121-
repository_url: https://upload.pypi.org/legacy/
122-
verbose: true
123-
env:
124-
LOGLEVEL: DEBUG
125-
126-
gcp_runner_deploy:
127-
runs-on: ubuntu-latest
128-
steps:
129-
- uses: actions/checkout@v2
130-
- name: Set up Python
131-
uses: actions/setup-python@v2
132-
with:
133-
python-version: '3.x'
134-
- name: Install dependencies
135-
run: |
136-
python -m pip install --upgrade pip
137-
pip install setuptools wheel twine
138-
- name: Build distribution
139-
run: |
140-
cd runners/mlcube_gcp
141-
python setup.py sdist bdist_wheel
142-
- name: Publish
143-
uses: pypa/gh-action-pypi-publish@release/v1
144-
with:
145-
user: ${{ secrets.PYPI_USER }}
146-
verify_metadata: true
147-
skip_existing: true
148-
password: ${{ secrets.PYPI_PASSWORD }}
149-
packages_dir: runners/mlcube_gcp/dist/
150-
repository_url: https://upload.pypi.org/legacy/
34+
repository_url: https://test.pypi.org/legacy/
15135
verbose: true
15236
env:
15337
LOGLEVEL: DEBUG
154-
155-
kubeflow_runner_deploy:
156-
runs-on: ubuntu-latest
157-
steps:
158-
- uses: actions/checkout@v2
159-
- name: Set up Python
160-
uses: actions/setup-python@v2
161-
with:
162-
python-version: '3.x'
163-
- name: Install dependencies
164-
run: |
165-
python -m pip install --upgrade pip
166-
pip install setuptools wheel twine
167-
- name: Build distribution
168-
run: |
169-
cd runners/mlcube_kubeflow
170-
python setup.py sdist bdist_wheel
171-
- name: Publish
172-
uses: pypa/gh-action-pypi-publish@release/v1
173-
with:
174-
user: ${{ secrets.PYPI_USER }}
175-
verify_metadata: true
176-
skip_existing: true
177-
password: ${{ secrets.PYPI_PASSWORD }}
178-
packages_dir: runners/mlcube_kubeflow/dist/
179-
repository_url: https://upload.pypi.org/legacy/
180-
verbose: true
181-
env:
182-
LOGLEVEL: DEBUG

0 commit comments

Comments
 (0)