Skip to content

publish-pypi-release #108

publish-pypi-release

publish-pypi-release #108

Workflow file for this run

name: publish-pypi-release
on:
workflow_dispatch:
inputs:
is_test:
description: 'Use Test Pypi'
required: true
type: boolean
default: true
jobs:
build-release:
name: Build and publish to pypi
runs-on: ubuntu-8core
timeout-minutes: 10
environment:
name: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: '18.x'
- run: |
pip install build twine
./build_dist.py
if [[ -n "$(git status weave_query/weave_query/frontend/sha1.txt --porcelain)" ]]
then
echo "::error cannot publish release, commited SHA does not match build SHA"
exit 1
fi
- name: upload test distribution
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ inputs.is_test }}
with:
repository-url: https://test.pypi.org/legacy/
- name: upload distribution
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ !inputs.is_test }}