-
Notifications
You must be signed in to change notification settings - Fork 195
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
Showing
1 changed file
with
68 additions
and
50 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,17 +1,39 @@ | ||
name: build-wheels-push | ||
|
||
# on: push | ||
on: push | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
# on: | ||
# release: | ||
# types: | ||
# - published | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build sdist | ||
shell: bash -l {-1} | ||
run: pipx run build --sdist | ||
|
||
- name: Check metadata | ||
run: pipx run twine check python/dist/* | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: cibw-sdist | ||
path: python/dist/*.tar.gz | ||
|
||
# - uses: actions/upload-artifact@v2 | ||
# with: | ||
# path: dist/*.tar.gz | ||
|
||
build_wheels: | ||
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} | ||
runs-on: ${{ matrix.buildplat[0] }} | ||
|
@@ -54,39 +76,64 @@ jobs: | |
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | ||
- uses: actions/upload-artifact@v3 | ||
# - uses: actions/upload-artifact@v3 | ||
# with: | ||
# path: ./wheelhouse/*.whl | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }} | ||
path: wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
upload_testpypi: | ||
name: >- | ||
Publish highspy to TestPyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
needs: [build_wheels, build_sdist] | ||
|
||
- name: Build sdist | ||
shell: bash -l {0} | ||
run: pipx run build --sdist | ||
# upload to PyPI on every tag starting with 'v' | ||
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
|
||
- uses: actions/upload-artifact@v3 | ||
environment: | ||
name: testpypi | ||
url: https://testpypi.org/p/highspy | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
# - uses: actions/download-artifact@v3 | ||
# with: | ||
# # unpacks default artifact into dist/ | ||
# # if `name: artifact` is omitted, the action will create extra parent dir | ||
# name: artifact | ||
# path: dist | ||
|
||
- name: Download all | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
path: dist/*.tar.gz | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
# upload_testpypi: | ||
# upload_pypi: | ||
# name: >- | ||
# Publish highspy to TestPyPI | ||
# Publish highspy to PyPI | ||
# runs-on: ubuntu-latest | ||
# needs: [build_wheels, build_sdist] | ||
|
||
# # upload to PyPI on every tag starting with 'v' | ||
# # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
|
||
# environment: | ||
# name: testpypi | ||
# url: https://testpypi.org/p/highspy | ||
# name: pypi | ||
# url: https://pypi.org/p/highspy | ||
|
||
# permissions: | ||
# id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
# steps: | ||
# - uses: actions/download-artifact@v3 | ||
# with: | ||
|
@@ -97,32 +144,3 @@ jobs: | |
|
||
# - name: Download all | ||
# uses: pypa/gh-action-pypi-publish@release/v1 | ||
# with: | ||
# repository-url: https://test.pypi.org/legacy/ | ||
|
||
upload_pypi: | ||
name: >- | ||
Publish highspy to PyPI | ||
runs-on: ubuntu-latest | ||
needs: [build_wheels, build_sdist] | ||
|
||
# upload to PyPI on every tag starting with 'v' | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
|
||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/highspy | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
# unpacks default artifact into dist/ | ||
# if `name: artifact` is omitted, the action will create extra parent dir | ||
name: artifact | ||
path: dist | ||
|
||
- name: Download all | ||
uses: pypa/gh-action-pypi-publish@release/v1 |