From a939846a68ed4362f50d6ae4c9317f7877a362f1 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 5 Oct 2023 09:37:08 -0400 Subject: [PATCH] use PyPI upload workflow from OpenAstronomy (#887) --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ .github/workflows/publish-to-pypi.yml | 24 ------------------------ pyproject.toml | 6 ++++++ 3 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..84b3fcbea --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: build + +on: + release: + types: [ released ] + pull_request: + workflow_dispatch: + +jobs: + check: + name: check that `requirements-sdp.txt` is populated + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - if: github.event_name == 'release' + run: grep -v '^ *#' requirements-sdp.txt + build: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 + needs: [ check ] + with: + upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }} + secrets: + pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml deleted file mode 100644 index 93fe1a7bb..000000000 --- a/.github/workflows/publish-to-pypi.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Publish to PyPI - -on: - release: - types: [released] - -jobs: - check: - name: check that `requirements-sdp.txt` is populated - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: grep -v '^ *#' requirements-sdp.txt - - run: if [[ -z $(grep -v '^ *#' requirements-sdp.txt) ]]; then echo requirements-sdp.txt is empty; exit 1; fi - publish: - needs: [ check ] - uses: spacetelescope/action-publish_to_pypi/.github/workflows/workflow.yml@master - with: - test: false - build_platform_wheels: false # Set to true if your package contains a C extension - secrets: - user: ${{ secrets.PYPI_USERNAME_STSCI_MAINTAINER }} - password: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} # WARNING: Do not hardcode secret values here! If you want to use a different user or password, you can override this secret by creating one with the same name in your Github repository settings. - test_password: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER_TEST }} diff --git a/pyproject.toml b/pyproject.toml index 4e42fcff6..dc1244f35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -192,3 +192,9 @@ extend-select = ['NPY'] [tool.ruff.extend-per-file-ignores] "romancal/associations/__init__.py" = ["E402"] + +[tool.cibuildwheel.macos] +archs = ["x86_64", "arm64"] + +[tool.cibuildwheel.linux] +archs = ["auto", "aarch64"]