|
1 | 1 | on:
|
2 | 2 | workflow_call:
|
3 |
| - |
4 |
| -concurrency: |
5 |
| - # Prevent race conditions |
6 |
| - # (If multiple commits have been pushed since the last release, this workflow may get triggered |
7 |
| - # on multiple commits. Without this, if the) |
8 |
| - group: dpw-release-python-package-${{ github.ref }} |
9 |
| - cancel-in-progress: true |
| 3 | + outputs: |
| 4 | + git-tag: |
| 5 | + description: Semantic version git tag |
| 6 | + value: ${{ jobs.tag.outputs.tag }} |
| 7 | + artifact-name: |
| 8 | + description: Python package distributions are uploaded to this GitHub artifact name |
| 9 | + value: python-package-distributions |
10 | 10 |
|
11 | 11 | jobs:
|
12 | 12 | tag:
|
13 | 13 | name: Tag release
|
14 | 14 | runs-on: ubuntu-latest
|
| 15 | + concurrency: |
| 16 | + # Prevent race conditions |
| 17 | + # (If multiple commits have been pushed since the last release, this workflow may get triggered |
| 18 | + # on multiple commits. Without this, if the) TODO |
| 19 | + group: dpw-release-python-package-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
15 | 21 | timeout-minutes: 5
|
16 | 22 | steps:
|
17 | 23 | - name: Get workflow version
|
18 | 24 | id: workflow-version
|
19 | 25 | uses: canonical/get-workflow-version-action@v1
|
20 | 26 | with:
|
21 | 27 | repository-name: canonical/data-platform-workflows
|
22 |
| - file-name: release_python_package.yaml |
| 28 | + file-name: release_python_package_part1.yaml |
23 | 29 | github-token: ${{ secrets.GITHUB_TOKEN }}
|
24 | 30 | - name: Install CLI
|
25 | 31 | run: pipx install git+https://github.com/canonical/data-platform-workflows@'${{ steps.workflow-version.outputs.sha }}'#subdirectory=python/cli
|
|
59 | 65 | - name: Store the distribution packages
|
60 | 66 | uses: actions/upload-artifact@v4
|
61 | 67 | with:
|
62 |
| - name: python-package-distributions |
63 |
| - path: dist/ |
64 |
| - |
65 |
| - release: |
66 |
| - name: Release to PyPI |
67 |
| - needs: |
68 |
| - - tag |
69 |
| - - build |
70 |
| - runs-on: ubuntu-latest |
71 |
| - timeout-minutes: 5 |
72 |
| - environment: production |
73 |
| - steps: |
74 |
| - - name: Download all the dists |
75 |
| - uses: actions/download-artifact@v4 |
76 |
| - with: |
77 |
| - name: python-package-distributions |
| 68 | + name: python-package-distributions # Keep in sync with `artifact-name` output |
78 | 69 | path: dist/
|
79 |
| - - name: Publish to PyPI |
80 |
| - # Use trusted publishing |
81 |
| - # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ |
82 |
| - uses: pypa/gh-action-pypi-publish@release/v1 |
83 |
| - - name: Create GitHub release |
84 |
| - run: gh release create '${{ needs.tag.outputs.tag }}' --verify-tag --generate-notes |
85 |
| - env: |
86 |
| - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments