Skip to content

Commit abf99ce

Browse files
authored
chore: add release workflow (#397)
1 parent f0f5c34 commit abf99ce

File tree

1 file changed

+28
-16
lines changed

1 file changed

+28
-16
lines changed

.github/workflows/cd.yml

+28-16
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
1-
name: cd
1+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
22

33
on:
44
release:
5-
types:
6-
- published
7-
8-
permissions:
9-
id-token: write
10-
contents: read
5+
types: [published] # This will trigger the workflow when you create a new release
116

127
jobs:
13-
publish_to_pypi:
14-
name: publish to pypi on new release
8+
build-n-publish:
9+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
1510
runs-on: ubuntu-latest
11+
permissions:
12+
# IMPORTANT: this permission is mandatory for trusted publishing
13+
id-token: write
1614
steps:
17-
- uses: actions/checkout@v3
18-
- uses: JRubics/[email protected]
19-
name: Build and publish to PyPI
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
2019
with:
21-
pypi_token: ${{ secrets.PYPI_TOKEN }}
22-
ignore_dev_requirements: "yes"
23-
repository_url: https://upload.pypi.org/legacy/
24-
repository_name: embedchain
20+
python-version: 3.10
21+
22+
- name: Install pep517
23+
run: |
24+
python -m pip install pep517 --user
25+
26+
- name: Build a binary wheel and a source tarball
27+
run: python -m pep517.build .
28+
29+
- name: Publish distribution 📦 to Test PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
repository_url: https://test.pypi.org/legacy/
33+
34+
- name: Publish distribution 📦 to PyPI
35+
if: startsWith(github.ref, 'refs/tags')
36+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)