Skip to content

Commit 7111103

Browse files
authored
Merge pull request #138 from lucasimi/develop
Updated deploy action
2 parents cfde752 + 6702438 commit 7111103

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,48 @@ on:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
77

88
jobs:
9-
deploy-job:
10-
name: Build and deploy
9+
build:
10+
name: Build
1111
runs-on: ubuntu-latest
12-
environment: pypi
1312
steps:
14-
- name: Check out repository code
13+
- name: Check out code
1514
uses: actions/checkout@v4
15+
1616
- name: Install Python
1717
uses: actions/setup-python@v4
1818
with:
1919
python-version: '3.10'
20+
2021
- name: Install dependencies
2122
run: |
2223
python -m pip install twine build
2324
python -m pip install -e .
24-
- name: Build package locally
25+
26+
- name: Build package
2527
run: |
2628
python -m build
2729
python -m twine check dist/*
28-
- name: Upload package to PyPI
29-
run: |
30-
python -m twine upload -r pypi dist/* --verbose
30+
31+
- name: Upload artifacts
32+
uses: actions/upload-artifact@v4
33+
with:
34+
path: ./dist
35+
36+
publish:
37+
name: Publish
38+
needs: [build]
39+
runs-on: ubuntu-latest
40+
environment: pypi
41+
permissions:
42+
id-token: write
43+
steps:
44+
- name: Download artifacts
45+
uses: actions/download-artifact@v4
46+
47+
- name: Publish to TestPyPI
48+
uses: pypa/gh-action-pypi-publish@release/v1
49+
with:
50+
repository-url: https://test.pypi.org/legacy/
51+
52+
- name: Publish to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)