Skip to content

Commit

Permalink
add pypi publish job; clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyMinucci committed Sep 26, 2024
1 parent 02e24fd commit d1a4870
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 68 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: CIBuildWheel
name: CI-Build-Publish

on:
push:
# branches:
# - main
paths:
branches:
- main
paths:
- pybeepop/**
- .github/workflows/ci-build-wheel.yml
- pyproject_cibw.toml
- .github/workflows/ci-build-publish.yml
- pyproject.toml
- build.py
# tags:
# - '*.*.*'
pull_request:
release:
types:
- published
- created

jobs:
build_wheels:
Expand All @@ -36,13 +39,9 @@ jobs:
uses: pypa/[email protected]
env:
CIBW_ARCHS: auto64
#CIBW_BUILD: "cp38-*, cp39-*, cp310-*, cp311-*, cp312-*"
CIBW_BUILD_VERBOSITY: 1
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
# ...
with:
# package-dir: .
# output-dir: wheelhouse
config-file: "pyproject.toml"

- uses: actions/upload-artifact@v4
Expand All @@ -64,15 +63,15 @@ jobs:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
upload_testpypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/pybeepop-plus
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
if: github.event_name == 'release' && github.event.action == 'created'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
Expand All @@ -86,4 +85,27 @@ jobs:
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
skip-existing: true

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pybeepop-plus
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
55 changes: 0 additions & 55 deletions pyproject_cibw.toml

This file was deleted.

0 comments on commit d1a4870

Please sign in to comment.