| James E. King III | 90ba804 | 2022-04-04 13:17:57 -0400 | [diff] [blame] | 1 | # |
| 2 | # Apache Thrift release publishing workflow |
| 3 | # |
| 4 | # When a release is created in GitHub, it should be created in pre-release |
| 5 | # mode first. This will trigger a "prereleased" event which will cause this |
| 6 | # workflow to run and publish packages to various package managers. You |
| 7 | # must check the Actions tab in GitHub to see the result of the workflow. |
| 8 | # |
| 9 | # github.event.action is either "prereleased" or "released" and corresponds |
| 10 | # with a named environment in CloudTruth |
| 11 | # |
| 12 | # | Destinations |
| 13 | # Language | Prereleased | Released |
| 14 | # ----------+---------------+--------------- |
| 15 | # py | test.pypi.org | pypi.org |
| 16 | # |
| 17 | --- |
| 18 | name: Publish |
| 19 | |
| 20 | on: |
| 21 | release: |
| 22 | types: |
| 23 | - prereleased |
| 24 | - released |
| 25 | |
| 26 | permissions: |
| 27 | contents: read |
| 28 | |
| 29 | jobs: |
| 30 | pypi: |
| 31 | runs-on: ubuntu-latest |
| 32 | timeout-minutes: 5 |
| 33 | steps: |
| dependabot[bot] | d90f2bb | 2025-12-01 06:29:38 +0000 | [diff] [blame] | 34 | - uses: actions/checkout@v6 |
| James E. King III | 90ba804 | 2022-04-04 13:17:57 -0400 | [diff] [blame] | 35 | with: |
| 36 | persist-credentials: false |
| 37 | submodules: recursive |
| dependabot[bot] | 724b038 | 2025-12-01 06:29:44 +0000 | [diff] [blame] | 38 | - uses: actions/setup-python@v6 |
| James E. King III | 90ba804 | 2022-04-04 13:17:57 -0400 | [diff] [blame] | 39 | - name: Get configuration and secrets from CloudTruth |
| 40 | uses: ./.github/actions/cloudtruth/configure-action |
| 41 | with: |
| 42 | apikey: "${{ secrets.CLOUDTRUTH_API_KEY }}" |
| 43 | project: "${{ github.repository }}" |
| 44 | environment: "${{ github.event.action }}" |
| 45 | - name: build sdist |
| 46 | run: "cd lib/py && python setup.py sdist" |
| 47 | - name: Publish to PyPI |
| 48 | uses: ./.github/actions/pypa/gh-action-pypi-publish |
| 49 | with: |
| 50 | password: "${{ env.PYPI_PASSWORD }}" |
| 51 | repository_url: "${{ env.PYPI_REPOSITORY }}" |
| 52 | packages_dir: lib/py/dist |