From ae3d4d9fbb66af629ed93b69d9b3c0b8dd172858 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Mon, 2 Oct 2023 10:34:26 -0400 Subject: [PATCH] use PyPI upload workflow from OpenAstronomy --- .github/workflows/build.yml | 19 ++++++++++++ .github/workflows/ci.yml | 1 - .github/workflows/publish-to-pypi.yml | 43 --------------------------- 3 files changed, 19 insertions(+), 44 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..4d843ed3d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,19 @@ +name: build + +on: + release: + types: [ released ] + pull_request: + workflow_dispatch: + +jobs: + build: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1 + with: + upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }} + targets: | + - cp3?-manylinux_x86_64 + - cp3?-macosx_x86_64 + sdist: true + secrets: + pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac809040a..898a5b58e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,6 @@ jobs: with: envs: | - linux: check-style - - linux: check-build test: uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 needs: [ crds ] diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml deleted file mode 100644 index 6f7d7211d..000000000 --- a/.github/workflows/publish-to-pypi.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Publish to PyPI - -on: - release: - types: [released] - -jobs: - validate: - name: Validate metadata - runs-on: ubuntu-latest - steps: - - uses: spacetelescope/action-publish_to_pypi/validate@master - - build_wheels: - name: Build wheels on ${{ matrix.os }} - needs: [validate] - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - - steps: - - uses: spacetelescope/action-publish_to_pypi/build-wheel@master - env: - CIBW_SKIP: "*-manylinux_i686" - - build_sdist: - name: Build source distribution - needs: [validate] - runs-on: ubuntu-latest - steps: - - uses: spacetelescope/action-publish_to_pypi/build-sdist@master - - upload_pypi_platform_wheels: - needs: [build_wheels, build_sdist] - runs-on: ubuntu-latest - steps: - - uses: spacetelescope/action-publish_to_pypi/publish@master - with: - test: false - 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 }} \ No newline at end of file