Skip to content

Commit

Permalink
test with official github action
Browse files Browse the repository at this point in the history
  • Loading branch information
jwfraustro committed Dec 6, 2023
1 parent 12971ed commit a10c665
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
41 changes: 29 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
name: Building & Publishing
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on: [push]

permissions:
contents: read

jobs:
# Release to PyPI after a RELEASE gets PUBLISHED in @spacetelescope/astrocut/main
publish-to-pypi:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
name: Publish to PyPI
publish:
runs-on: ubuntu-latest

# We only want to upload to PyPI after a new release has been published on the @spacetelescope/astrocut repo
if: github.repository_owner == 'spacetelescope' && github.event_name == 'push'
with:
test_extras: test
test_command: pytest --cov=tests/
secrets:
pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- 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@master
with:
user: ${{ secrets.PYPI_USERNAME_STSCI_MAINTAINER }}
password: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }}
repository_url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools"]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
Expand Down

0 comments on commit a10c665

Please sign in to comment.