Skip to content

v0.4.1

v0.4.1 #6

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
workflow_dispatch:
inputs:
environment:
description: 'Environment to publish to'
required: true
default: 'test'
type: choice
options:
- test
- Production
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC
contents: read
environment:
name: ${{ github.event.inputs.environment || 'Production' }}
url: https://pypi.org/p/syrin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: playground/package-lock.json
- name: Build playground
run: |
cd playground
npm ci
npm run build
mkdir -p ../src/syrin/serve/playground_static
cp -r out/* ../src/syrin/serve/playground_static/
- name: Install build
run: pip install build
- name: Build package
run: python -m build
- name: Install twine
run: pip install twine
- name: Check package
run: twine check dist/*
- name: Publish to PyPI (Trusted Publisher)
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event.inputs.environment == 'Production' || github.event_name == 'release'
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish to Test PyPI (Trusted Publisher)
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
if: github.event.inputs.environment == 'test'