Release to NPM and PyPI #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release to NPM and PyPI | |
# Builds and releases the application to NPM and PyPI | |
# when a new release is published or the workflow is manually triggered. | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
env: | |
# AWS_REGION: xxxxst-2 | |
# CACHE_VERSION: xxxx | |
# SNYK_TOKEN: xxxxa727 | |
TWINE_NON_INTERACTIVE: true | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
TWINE_REPOSITORY_URL: ${{ secrets.TWINE_REPOSITORY_URL }} | |
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
jobs: | |
release_to_npm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.20.0 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install Node dependencies | |
run: npm install | |
- name: Build React application | |
run: |- | |
node -v | |
make build | |
- name: Publish to npm | |
run: npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
release_to_pypi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Tests | |
uses: "./.github/actions/setup_tests" | |
- name: Make Python package | |
run: make package | |
- name: Install twine | |
run: python -m pip install -U twine | |
- name: Publish to PyPI | |
run: python -m twine upload package/dist/* |