Skip to content

Commit

Permalink
modify github actions to test for testpypi
Browse files Browse the repository at this point in the history
  • Loading branch information
strawpants committed Jan 30, 2024
1 parent 387f95f commit f73eac2
Showing 1 changed file with 44 additions and 19 deletions.
63 changes: 44 additions & 19 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,59 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Build and upload Python Package
name: Build and Publish shxarray distribution 📦 to PyPI and TestPyPI

on:
release:
types: [published]
on: push
#release:
#types: [published]

permissions:
contents: read

jobs:
deploy:

build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/shxarray

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@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
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

0 comments on commit f73eac2

Please sign in to comment.