Skip to content

Commit

Permalink
Merge pull request #42 from TOMToolkit/38-tom-fink-release-to-pypi
Browse files Browse the repository at this point in the history
tom fink release to pypi
  • Loading branch information
jchate6 authored Mar 25, 2024
2 parents eaff1b2 + 3e0b880 commit 054ced6
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create Github Release

on:
push:
tags:
- "*.*.*"
- "*.*.*-alpha.*"
- "*.*.*-beta.*"
- "*.*.*-rc.*"

jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install
- name: Run tests
run: poetry run python tom_fink/tests/run_tests.py

create_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
29 changes: 29 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release to PyPi

on:
release:
types: [published]

jobs:
publish_to_pypi:
runs-on: ubuntu-latest
environment: release # configured in repo Settings/Environments; referenced in PyPI OIDC
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.11' # numpy is a problem with 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry config virtualenvs.create false # tell poetry not to create a new virtual environment
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build package with poetry
run: |
poetry build -f wheel
poetry build -f sdist
- name: Publish to PyPI with pypi-publish (trusted publishing)
uses: pypa/[email protected]

0 comments on commit 054ced6

Please sign in to comment.