|
1 |
| -name: Publish PyPi package |
2 |
| - |
| 1 | +--- |
| 2 | +name: Publish Pypi package |
3 | 3 | on:
|
4 | 4 | workflow_call:
|
5 |
| - |
6 | 5 | jobs:
|
7 | 6 | publish_to_pypi:
|
8 | 7 | name: Publish Python 🐍 package 📦 to PyPI
|
9 | 8 | runs-on: ubuntu-latest
|
| 9 | + permissions: |
| 10 | + # This permission is required for trusted publishing. |
| 11 | + id-token: write |
| 12 | + contents: read |
10 | 13 | env:
|
11 |
| - PYTHONIOENCODING: "utf-8" |
12 |
| - |
| 14 | + ZENML_DEBUG: 1 |
| 15 | + ZENML_ANALYTICS_OPT_IN: false |
| 16 | + PYTHONIOENCODING: utf-8 |
13 | 17 | steps:
|
14 |
| - - uses: actions/checkout@v3 |
15 |
| - |
| 18 | + |
16 | 19 | - name: Get the version from the github tag ref
|
17 | 20 | id: get_version
|
18 | 21 | run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
19 |
| - |
20 | 22 | - name: Set up Python
|
21 |
| - uses: actions/setup-python@v2 |
| 23 | + uses: actions/setup-python@v5.0.0 |
22 | 24 | with:
|
23 | 25 | python-version: "3.8"
|
24 |
| - |
25 | 26 | - name: Install Poetry
|
26 |
| - uses: snok/install-poetry@v1 |
| 27 | + uses: snok/install-poetry@v1.3.4 |
27 | 28 | with:
|
28 | 29 | virtualenvs-create: true
|
29 | 30 | virtualenvs-in-project: true
|
30 |
| - |
31 |
| - - name: publish |
32 |
| - env: |
33 |
| - PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} |
34 |
| - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |
35 |
| - run: | |
36 |
| - if [ "$(cat src/mlstacks/VERSION)" = "$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" ]; |
37 |
| - then ./scripts/publish.sh; |
| 31 | + - name: Include latest dashboard |
| 32 | + run: bash scripts/install-dashboard.sh |
| 33 | + - name: Build package |
| 34 | + run: poetry build |
| 35 | + - name: Mint token |
| 36 | + id: mint |
| 37 | + |
| 38 | + - name: Publish the package with poetry |
| 39 | + run: |- |
| 40 | + if [ "$(cat src/zenml/VERSION)" = "$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" ]; |
| 41 | + then poetry publish -u __token__ -p '${{ steps.mint.outputs.api-token }}'; |
38 | 42 | else echo "Version mismatch between src/zenml/VERSION and branch tag" && exit 1;
|
39 | 43 | fi
|
0 commit comments