update workflow #10
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: Upload Python Package to PYPI | ||
on: | ||
release: | ||
types: [created] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
python-version: 3.11 | ||
channels: conda-forge | ||
auto-update-conda: true | ||
miniconda-version: "latest" | ||
activate-environment: pypi | ||
- name: Set up Conda environment | ||
shell: bash -l {0} | ||
run: | | ||
conda config --set always_yes yes --set changeps1 no | ||
conda install -q -n pypi python=3.11 \ | ||
setuptools \ | ||
pypandoc \ | ||
build \ | ||
twine | ||
conda list -n pypi | ||
- name: Build and publish | ||
permissions: | ||
id-token: write | ||
shell: bash -l {0} | ||
run: | | ||
conda env list | ||
python -m build . | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: true |