-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (47 loc) · 1.55 KB
/
publish_python.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
name: publish_python_package
on:
push:
tags:
- '*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: main
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- uses: actions/setup-node@v1
with:
node-version: 12.x
registry-url: https://registry.npmjs.org/
scope: '@codytodonnell'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install twine
npm i
- name: Build tarball
run: |
npm run build
python setup.py sdist
- name: Publish package to NPM
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish a Python distribution to test PyPI
env:
PI_PY_SECRET: ${{ secrets.PYPI_TOKEN }}
PI_PY_USERTOKEN: __token__
run: |
echo Publishing to test repo $PI_PY_USERTOKEN
twine upload dist/* -u $PI_PY_USERTOKEN -p $PI_PY_SECRET