Yuxuan 'fishy' Wang | 3b1c30c | 2024-02-19 14:24:51 -0800 | [diff] [blame^] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
Yuxuan 'fishy' Wang | 84b35ff | 2024-02-07 17:42:39 -0800 | [diff] [blame] | 20 | name: "PyPI publishing" |
| 21 | |
| 22 | on: |
| 23 | release: |
| 24 | types: [published] |
| 25 | |
| 26 | jobs: |
| 27 | pypi-publish: |
| 28 | name: Publish release to PyPI |
| 29 | runs-on: ubuntu-latest |
| 30 | # Specifying a GitHub environment is optional, but strongly encouraged |
| 31 | environment: release |
| 32 | permissions: |
| 33 | # IMPORTANT: this permission is mandatory for trusted publishing |
| 34 | id-token: write |
| 35 | steps: |
| 36 | - uses: actions/checkout@v4 |
| 37 | |
| 38 | - name: Set up Python |
| 39 | uses: actions/setup-python@v5 |
| 40 | with: |
| 41 | python-version: "3.8" |
| 42 | |
| 43 | - name: Build |
| 44 | run: | |
| 45 | cd lib/py |
| 46 | python setup.py sdist |
| 47 | |
| 48 | - name: Publish package distributions to PyPI |
| 49 | uses: pypa/gh-action-pypi-publish@release/v1 |
| 50 | with: |
| 51 | packages-dir: lib/py/dist/ |