blob: ab1b91e0fa870d679867f76cda90a25f5c316a38 [file] [log] [blame]
James E. King III90ba8042022-04-04 13:17:57 -04001#
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---
18name: Publish
19
20on:
21 release:
22 types:
23 - prereleased
24 - released
25
26permissions:
27 contents: read
28
29jobs:
30 pypi:
31 runs-on: ubuntu-latest
32 timeout-minutes: 5
33 steps:
dependabot[bot]d90f2bb2025-12-01 06:29:38 +000034 - uses: actions/checkout@v6
James E. King III90ba8042022-04-04 13:17:57 -040035 with:
36 persist-credentials: false
37 submodules: recursive
dependabot[bot]724b0382025-12-01 06:29:44 +000038 - uses: actions/setup-python@v6
James E. King III90ba8042022-04-04 13:17:57 -040039 - 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