-
Notifications
You must be signed in to change notification settings - Fork 196
43 lines (37 loc) · 1013 Bytes
/
python-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Python Publish to PYPI
on:
release:
types: published
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch to release from'
required: true
defaults:
run:
shell: bash
working-directory: python/
jobs:
publish:
if: >
(github.event.inputs) ||
(startsWith(github.event.release.tag_name, 'looker_sdk') &&
!github.event.release.draft &&
!github.event.release.prerelease)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || github.event.inputs.ref }}
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Package release artifacts
run: |
pip install wheel
python setup.py sdist bdist_wheel
- uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: python/dist/