From 06a285bc591cd9d42a1daf046102b763f9c7b40a Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Wed, 22 Nov 2023 13:51:38 -0700 Subject: [PATCH] Publish Package to pypi (#62) * pypi publish workflow * actually build the package * update ci workflows while we're at it --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/publish.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 98430c3..3e0faf1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,9 +22,9 @@ jobs: os: ["ubuntu-latest"] python-version: ["3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache conda - uses: actions/cache@v2 + uses: actions/cache@v3 env: # Increase this value to reset cache if ci/environment.yaml has not changed CACHE_NUMBER: 0 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..7c7efc8 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,29 @@ +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/xesn + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1