-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (68 loc) · 2.29 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python PyPi and Conda
on:
release:
types: [created]
# schedule:
# - cron: '1 6 * * *'
workflow_dispatch: #allows you to trigger manually
push:
branches:
- main
jobs:
deploy_python_pypi:
name: "Deploy Python PyPi"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/* || echo "File Already exists"; exit 0
# Disable usage of conda since it never installs correctly.
# deploy_python_conda:
# runs-on: ubuntu-latest
# name: "Deploy Python Conda"
# needs: deploy_python_pypi
# strategy:
# max-parallel: 5
# timeout-minutes: 500
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python 3.6
# uses: actions/setup-python@v2
# with:
# python-version: 3.6
# - name: Add conda to system path
# run: |
# # $CONDA is an environment variable pointing to the root of the miniconda directory
# echo $CONDA/bin >> $GITHUB_PATH
# - name: Install dependencies
# run: |
# conda install -y -c fastchan conda-build anaconda-client fastrelease
# - name: Build Conda package
# timeout-minutes: 360
# run: |
# fastrelease_conda_package --do_build false
# cd conda
# conda build --no-anaconda-upload --output-folder build fastrl -c fastchan
# anaconda upload build/noarch/fastrl-*-*.tar.bz2
# env:
# ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
# - name: Test package import
# run: |
# conda install -c josiahls fastrl
# conda update -c josiahls fastrl
# python -c "import fastrl"