Skip to content

Commit

Permalink
Add publish-test.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Stormheg committed Oct 17, 2023
1 parent 99c14c6 commit 5f4428e
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish to Test PyPI
on:
release:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
types: [prereleased]
jobs:
test:
uses: ./.github/workflows/test.yml

build:
needs: ['test']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 14

- name: Install Node dependencies
run: |
npm ci
- name: Compile JavaScript
run: |
npm run build
- uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install Python dependencies
run: pip install build

- name: Build package distributions
run: python -m build

- uses: actions/upload-artifact@v3
with:
path: ./dist

# https://docs.pypi.org/trusted-publishers/using-a-publisher/
pypi-publish:
needs: ['build']
environment: 'publish-test'

name: upload release to TestPyPI
runs-on: ubuntu-latest
permissions:
# Mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v3

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: artifact/
print-hash: true
repository-url: https://test.pypi.org/legacy/

0 comments on commit 5f4428e

Please sign in to comment.