From 3a8fe162c0f9fda55c2de442f622ab32d0ce5a56 Mon Sep 17 00:00:00 2001 From: liwt31 Date: Mon, 15 Jan 2024 16:08:28 +0800 Subject: [PATCH] add pypi ci --- .github/workflows/ci.yml | 3 +++ .github/workflows/publish_pypi.yml | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/publish_pypi.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e090797..43c69db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,9 @@ jobs: python -m pip install --upgrade pip pip install --no-cache-dir -r requirements.txt pip install --no-cache-dir -r requirements-dev.txt + - name: check env + run : | + pip freeze - name: run black run: | black . --check --verbose || echo "return 0" diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml new file mode 100644 index 0000000..3bcd36e --- /dev/null +++ b/.github/workflows/publish_pypi.yml @@ -0,0 +1,23 @@ +name: publish to pypi +on: workflow_dispatch +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/tencirchem + permissions: + id-token: write + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + cache: "pip" + - name: Build to sdist + run: | + python setup.py sdist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1