Skip to content

publish_python_package #233

publish_python_package

publish_python_package #233

Workflow file for this run

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