Taylor Fox Dahlin commited on
Commit
4faaa5f
·
unverified ·
1 Parent(s): d282c0a

Github workflow for publish to PyPI (#871)

Browse files

* Github workflow to build and release pytube as a pypi package

* Remove automated github release workflow in favor of semi-automated pypi release workflow.

.github/workflows/pypi-publish.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # .github/workflows/pypi-publish.yml
2
+ name: Publish to PyPI
3
+
4
+ on:
5
+ release:
6
+ types: [ created ]
7
+
8
+ jobs:
9
+ deploy:
10
+ if: github.actor == 'nficano' || github.actor == 'RONNCC' || github.actor == 'tfdahlin'
11
+ name: Build Python distribution and publish to PyPI
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout repo
15
+ uses: actions/checkout@v2
16
+ - name: Setup python 3.8
17
+ uses: actions/setup-python@v2
18
+ with:
19
+ python-version: 3.8
20
+
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install build setuptools wheel twine
25
+
26
+ - name: Build and publish
27
+ env:
28
+ TWINE_USERNAME: __token__
29
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
30
+ run: |
31
+ python -m build
32
+ python -m twine upload dist/*
.github/workflows/release.yml DELETED
@@ -1,17 +0,0 @@
1
- # .github/workflows/release.yml
2
- name: Release
3
-
4
- on:
5
- pull_request:
6
- types: closed
7
-
8
- jobs:
9
- build:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - name: Tag
13
- uses: K-Phoen/semver-release-action@master
14
- with:
15
- release_branch: master
16
- env:
17
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}