Skip to content

add publish action

add publish action #1

Workflow file for this run

name: publish

Check failure on line 1 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.yml

Invalid workflow file

Invalid type for `job.environment`
on:
push:
branches: main
tags:
- "hawc-client-[0-9]+.[0-9]+"
workflow_dispatch:
jobs:
publish hawc-client:
runs-on: ubuntu-22.04
permissions:
id-token: write
environment:
environment: publish
environment_url: https://test.pypi.org/project/hawc-client/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'
cache: 'pip'
- name: install
run: python -m pip install -U pip wheel flit
- name: Build client
run: cd client && flit build
- name: Publish package to TestPyPI
if: secrets.PUBLISH_PYPI != ""
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
attestations: true
print-hash: true
packages-dir: client/dist/