Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add action #16

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/publish_on_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
workflow_dispatch:

name: Publish on PyPi

env:
PYTHON_VERSION: "3.9"

jobs:
Create_PyPi_Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ env.PYTHON_VERSION }}
- name: Conda info
shell: bash -le {0}
run: conda info
- name: Prepare distribution
shell: bash -le {0}
run: |
conda create -n pylmd_build python=${{ env.PYTHON_VERSION }} -y
conda activate pylmd_build
python -m pip install --upgrade pip
pip install build twine
rm -rf dist
rm -rf build
python -m build
twine check dist/*
conda deactivate
conda env remove --name pylmd_build -y
conda clean --all -y
- name: Publish distribution to Test-PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
- name: Test Test-PyPI loose installation
shell: bash -le {0}
run: |
conda create -n pip_loose_test python=${{ env.PYTHON_VERSION }} -y
conda activate pip_loose_test
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "py-lmd"
alphadia -v
conda deactivate
conda env remove --name pip_stable_test -y
conda clean --all -y
Loading