Skip to content

Commit ed2e6bd

Browse files
authored
Add action for publish ADS to PyPI (#136)
1 parent 5ddef7e commit ed2e6bd

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "[DO NOT TRIGGER] Publish to PyPI"
2+
3+
# To run this workflow manually from the Actions tab
4+
on: workflow_dispatch
5+
6+
jobs:
7+
build-n-publish:
8+
name: Build and publish Python 🐍 distribution 📦 to PyPI
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: "3.x"
17+
- name: Build distribution 📦
18+
run: |
19+
pip install wheel
20+
make dist
21+
- name: Validate
22+
run: |
23+
pip install dist/*.whl
24+
python -c "import ads;"
25+
## To run publish to test PyPI secret with token needs to be added,
26+
## this one GH_ADS_TESTPYPI_TOKEN - removed after initial test.
27+
## Project name also needed to be updated in setup.py - setup(name="test_oracle_ads", ...),
28+
## regular name is occupied by former developer and can't be used for testing
29+
# - name: Publish distribution 📦 to Test PyPI
30+
# env:
31+
# TWINE_USERNAME: __token__
32+
# TWINE_PASSWORD: ${{ secrets.GH_ADS_TESTPYPI_TOKEN }}
33+
# run: |
34+
# pip install twine
35+
# twine upload -r testpypi dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD
36+
- name: Publish distribution 📦 to PyPI
37+
env:
38+
TWINE_USERNAME: __token__
39+
TWINE_PASSWORD: ${{ secrets.GH_ADS_PYPI_TOKEN }}
40+
run: |
41+
pip install twine
42+
twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD

0 commit comments

Comments
 (0)