-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
159 create an action to publish to pypi when we make a release (#184)
* testing automated pypi release * trying to appropriately name the wheels * only need one version of python to build wheels for all other versions * trying to get macos to build successfully * excluding universal2 arch build for macos * seeing if arm64 works * trying to skip musllinux * trying to choose linux architecture support * trying to skip musllinux again * adding intel based mac build * trying to set the osx deployment target * trying a different way * that wasn't it * trying to force a minimum of 10.15 for macos? * setting action trigger * undoing version change * correcting project name
- Loading branch information
Showing
2 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Publish Python Package | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build_sdist: | ||
name: Build SDist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Build SDist | ||
run: pipx run build --sdist | ||
|
||
- name: Check metadata | ||
run: pipx run twine check dist/* | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} with Python ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ["3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: arm64 x86_64 | ||
CIBW_SKIP: cp27-* cp34-* cp35-* cp36-* *musllinux* | ||
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* | ||
|
||
- name: Verify clean directory | ||
run: git diff --exit-code | ||
shell: bash | ||
|
||
- name: Upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-py${{ matrix.python-version }} | ||
path: wheelhouse/*.whl | ||
|
||
upload_all: | ||
name: Upload release | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/musica | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters