-
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.
- Loading branch information
1 parent
522cbc7
commit fb64ed9
Showing
2 changed files
with
43 additions
and
143 deletions.
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
--- | ||
name: Build wheels and deploy to PyPI | ||
name: Build and deploy to TestPyPI | ||
|
||
on: | ||
release: | ||
types: [published, edited] | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- 'v*' | ||
- '*' | ||
release: | ||
types: [published, edited] | ||
repository_dispatch: | ||
types: [trigger_checks] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
@@ -16,29 +20,25 @@ jobs: | |
strategy: | ||
matrix: | ||
# macos-13 is an intel runner, macos-14 is apple silicon | ||
os: [ubuntu-latest, macos-13, macos-14] | ||
os: [ubuntu-24.04, macos-13, macos-14] | ||
fail-fast: false | ||
env: | ||
CIBW_BEFORE_ALL_LINUX: curl -sSf https://sh.rustup.rs | sh -s -- -y | ||
CIBW_ENVIRONMENT_LINUX: 'PATH=$HOME/.cargo/bin:$PATH' | ||
CIBW_ENVIRONMENT_PASS_LINUX: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install setuptools_scm | ||
if: matrix.os == 'macos-13' || matrix.os == 'macos-14' | ||
run: | | ||
python3 -m pip install --upgrade --break-system-packages --user setuptools setuptools_scm[toml] setuptools-rust | ||
- name: Install setuptools_scm | ||
if: matrix.os != 'macos-13' && matrix.os != 'macos-14' | ||
run: | | ||
python3 -m pip install --upgrade setuptools setuptools_scm[toml] setuptools-rust | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: .python-version | ||
|
||
- name: Run setuptools_scm | ||
- name: Install dependencies | ||
run: | | ||
python3 -m setuptools_scm --strip-dev | ||
python3 -m pip install --upgrade uv | ||
python3 -m uv pip install --upgrade setuptools setuptools_scm[toml] setuptools-rust wheel twine build | ||
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS=$(python3 -m setuptools_scm --strip-dev)" >> $GITHUB_ENV | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
@@ -50,53 +50,62 @@ jobs: | |
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run setuptools_scm | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: .python-version | ||
|
||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade setuptools setuptools_scm[toml] setuptools-rust | ||
python3 -m setuptools_scm --strip-dev | ||
python3 -m pip install --upgrade setuptools setuptools_scm[toml] setuptools-rust wheel twine build | ||
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS=$(python3 -m setuptools_scm --strip-dev)" >> $GITHUB_ENV | ||
- name: Build sdist | ||
run: pipx run build --sdist | ||
run: | | ||
export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS=$(python3 -m setuptools_scm --strip-dev) | ||
python3 -m build --sdist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
|
||
upload_pypi: | ||
deploy: | ||
name: Upload to PyPI | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: release | ||
runs-on: ubuntu-24.04 | ||
environment: test | ||
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') | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: .python-version | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
# unpacks all CIBW artifacts into dist/ | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Run setuptools_scm | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade setuptools setuptools_scm[toml] setuptools-rust | ||
python3 -m setuptools_scm --strip-dev | ||
python3 -m pip install --upgrade uv | ||
python3 -m uv pip install --upgrade setuptools setuptools_scm[toml] setuptools-rust wheel twine build | ||
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ARTISTOOLS=$(python3 -m setuptools_scm --strip-dev)" >> $GITHUB_ENV | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: false | ||
skip-existing: true | ||
verbose: false |
This file was deleted.
Oops, something went wrong.