Skip to content

Commit

Permalink
test sdist testpypi
Browse files Browse the repository at this point in the history
  • Loading branch information
galabovaa committed Dec 16, 2024
1 parent 1e3fbe5 commit 68b8133
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 36 deletions.
73 changes: 37 additions & 36 deletions .github/workflows/build-wheels-push.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: build-wheels-push

# on: push
on: push

on:
release:
Expand All @@ -22,13 +22,13 @@ jobs:
shell: bash
run: pipx run build --sdist

# - name: check metadata
# run: pipx run twine check python/dist/*
- name: check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: python/dist/*.tar.gz
path: dist/*.tar.gz

build_wheels:
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
Expand Down Expand Up @@ -81,21 +81,50 @@ jobs:
name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }}
path: wheelhouse/*.whl

# upload_testpypi:
upload_testpypi:
name: >-
Publish highspy to TestPyPI
runs-on: ubuntu-latest
# needs: [build_wheels, build_sdist]
needs: [build_sdist]

# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

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

- 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 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')

# 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@v4
# with:
Expand All @@ -105,31 +134,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@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true

- name: Download all
uses: pypa/gh-action-pypi-publish@release/v1
3 changes: 3 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
shell: bash
run: pipx run build --sdist

- name: check metadata
run: pipx run twine check dist/*

build_wheels:
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
runs-on: ${{ matrix.buildplat[0] }}
Expand Down

0 comments on commit 68b8133

Please sign in to comment.