Skip to content

Commit 4d4a7ba

Browse files
authored
Merge pull request #3 from oracle/ODSC-42786/add_publish_to_pypi_action
Add github action to publish to pypi
2 parents 2ab26cc + 510a583 commit 4d4a7ba

File tree

2 files changed

+47
-4
lines changed

2 files changed

+47
-4
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 oci_mlflow;"
25+
# To run publish to test PyPI, secret with token needs to be added to oracle/oci-mlflow project.
26+
# This one - GH_OCI_MLFLOW_TESTPYPI_TOKEN - removed from project secrets after initial test.
27+
- name: Publish distribution 📦 to Test PyPI
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.GH_OCI_MLFLOW_TESTPYPI_TOKEN }}
31+
run: |
32+
pip install twine
33+
twine upload -r testpypi dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD
34+
# - name: Publish distribution 📦 to PyPI
35+
# env:
36+
# TWINE_USERNAME: __token__
37+
# TWINE_PASSWORD: ${{ secrets.GH_OCI_MLFLOW_PYPI_TOKEN }}
38+
# run: |
39+
# pip install twine
40+
# twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
include .env
1+
-include .env
22

3-
.PHONY: build clean deploy
3+
.PHONY: clean dist wheel
44

55
TAG:=latest
66
IMAGE_NAME:=oci-mlflow
@@ -9,11 +9,14 @@ RND:=1
99

1010
clean:
1111
@rm -rf dist build oci_mlflow.egg-info
12+
@find ./ -name '*.pyc' -exec rm -f {} \;
13+
@find ./ -name 'Thumbs.db' -exec rm -f {} \;
14+
@find ./ -name '*~' -exec rm -f {} \;
1215

13-
build: clean
16+
dist: clean
1417
@python setup.py bdist_wheel
1518

16-
wheel: build tmp-copy-whl
19+
wheel: dist tmp-copy-whl
1720

1821
build-image:
1922
docker build --network host --build-arg RND=$(RND) -t $(IMAGE_NAME):$(TAG) -f container-image/Dockerfile .

0 commit comments

Comments
 (0)