Skip to content

Commit

Permalink
SYS: Configure automatic PyPi publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd OST committed May 31, 2024
1 parent 306e2a2 commit 64ed790
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: push
jobs:
build:
name: Build docs
runs-on: macos-latest
runs-on: macos-11

steps:
- name: Checkout
Expand Down Expand Up @@ -38,4 +38,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
force: true
50 changes: 0 additions & 50 deletions .github/workflows/publish.yaml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish package

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@master

- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Install packages
run: |
python -m pip install build twine
- name: Build
run: |
python -m build
- name: Upload to PyPi
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
23 changes: 22 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,28 @@ on:
jobs:
mac-tests:
name: Run tests on Mac
runs-on: macos-latest
runs-on: macos-11

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install package and dependencies
run: |
python3 -m pip install -e .[tests]
- name: Run tests
run: |
pytest
windows-tests:
name: Run tests on Windows
runs-on: windows-latest

steps:
- name: Checkout
Expand Down

0 comments on commit 64ed790

Please sign in to comment.