|
| 1 | +name: Publish Python distribution to PyPI |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build-common: |
| 9 | + name: Build distribution 📦 |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + with: |
| 15 | + persist-credentials: false |
| 16 | + - name: Set up Python |
| 17 | + uses: actions/setup-python@v5 |
| 18 | + with: |
| 19 | + python-version: "3.10" |
| 20 | + - name: Install pypa/build |
| 21 | + run: >- |
| 22 | + python3 -m |
| 23 | + pip install |
| 24 | + build |
| 25 | + --user |
| 26 | + - name: Build a binary wheel and a source tarball |
| 27 | + run: | |
| 28 | + cd daliuge-common |
| 29 | + python3 -m build --sdist && python -m build --wheel |
| 30 | + - name: Store the distribution packages |
| 31 | + uses: actions/upload-artifact@v4 |
| 32 | + with: |
| 33 | + name: daliuge-common-dist |
| 34 | + path: daliuge-common/dist/ |
| 35 | + |
| 36 | + build-engine: |
| 37 | + name: Build daluge-engine |
| 38 | + runs-on: ubuntu-latest |
| 39 | + |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + with: |
| 43 | + persist-credentials: false |
| 44 | + - name: Set up Python |
| 45 | + uses: actions/setup-python@v5 |
| 46 | + with: |
| 47 | + python-version: "3.10" |
| 48 | + - name: Install pypa/build |
| 49 | + run: >- |
| 50 | + python3 -m |
| 51 | + pip install |
| 52 | + build |
| 53 | + --user |
| 54 | + - name: Build a binary wheel and a source tarball |
| 55 | + run: | |
| 56 | + cd daliuge-engine |
| 57 | + python3 -m build --sdist && python -m build --wheel |
| 58 | + - name: Store the distribution packages |
| 59 | + uses: actions/upload-artifact@v4 |
| 60 | + with: |
| 61 | + name: daliuge-engine-dist |
| 62 | + path: daliuge-engine/dist/ |
| 63 | + |
| 64 | + build-translator: |
| 65 | + name: Build daluge-translator |
| 66 | + runs-on: ubuntu-latest |
| 67 | + |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v4 |
| 70 | + with: |
| 71 | + persist-credentials: false |
| 72 | + - name: Set up Python |
| 73 | + uses: actions/setup-python@v5 |
| 74 | + with: |
| 75 | + python-version: "3.10" |
| 76 | + - name: Install pypa/build |
| 77 | + run: >- |
| 78 | + python3 -m |
| 79 | + pip install |
| 80 | + build |
| 81 | + --user |
| 82 | + - name: Build a binary wheel and a source tarball |
| 83 | + run: | |
| 84 | + cd daliuge-translator |
| 85 | + python3 -m build --sdist && python -m build --wheel |
| 86 | + - name: Store the distribution packages |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: daliuge-translator-dist |
| 90 | + path: daliuge-translator/dist/ |
| 91 | + |
| 92 | + publish-common: |
| 93 | + name: Publish daliuge-common |
| 94 | + needs: |
| 95 | + - build-common |
| 96 | + runs-on: ubuntu-latest |
| 97 | + |
| 98 | + environment: |
| 99 | + name: pypi |
| 100 | + url: https://pypi.org/p/daliuge-common |
| 101 | + |
| 102 | + permissions: |
| 103 | + id-token: write # IMPORTANT: mandatory for trusted publishing |
| 104 | + |
| 105 | + steps: |
| 106 | + - name: Download all the dists |
| 107 | + uses: actions/download-artifact@v4 |
| 108 | + with: |
| 109 | + name: daliuge-common-dist |
| 110 | + path: dist/ |
| 111 | + - name: Publish distribution 📦 to TestPyPI |
| 112 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 113 | + with: |
| 114 | + verbose: true |
| 115 | + |
| 116 | + publish-engine: |
| 117 | + name: Publish daliuge-engine |
| 118 | + needs: |
| 119 | + - build-engine |
| 120 | + runs-on: ubuntu-latest |
| 121 | + |
| 122 | + environment: |
| 123 | + name: pypi |
| 124 | + url: https://pypi.org/p/daliuge-engine |
| 125 | + |
| 126 | + permissions: |
| 127 | + id-token: write # IMPORTANT: mandatory for trusted publishing |
| 128 | + |
| 129 | + steps: |
| 130 | + - name: Download all the dists |
| 131 | + uses: actions/download-artifact@v4 |
| 132 | + with: |
| 133 | + name: daliuge-engine-dist |
| 134 | + path: dist/ |
| 135 | + - name: Publish distribution 📦 to TestPyPI |
| 136 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 137 | + with: |
| 138 | + verbose: true |
| 139 | + |
| 140 | + publish-translator: |
| 141 | + name: Publish daliuge-translator |
| 142 | + needs: |
| 143 | + - build-translator |
| 144 | + runs-on: ubuntu-latest |
| 145 | + |
| 146 | + environment: |
| 147 | + name: pypi |
| 148 | + url: https://pypi.org/p/daliuge-translator |
| 149 | + |
| 150 | + permissions: |
| 151 | + id-token: write # IMPORTANT: mandatory for trusted publishing |
| 152 | + |
| 153 | + steps: |
| 154 | + - name: Download all the dists |
| 155 | + uses: actions/download-artifact@v4 |
| 156 | + with: |
| 157 | + name: daliuge-translator-dist |
| 158 | + path: dist/ |
| 159 | + - name: Publish distribution 📦 to TestPyPI |
| 160 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 161 | + with: |
| 162 | + verbose: true |
| 163 | + |
0 commit comments