Skip to content

Commit

Permalink
testpypi updated artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
galabovaa committed Oct 18, 2024
1 parent fcfb534 commit d3dbd6e
Showing 1 changed file with 68 additions and 50 deletions.
118 changes: 68 additions & 50 deletions .github/workflows/build-wheels-push.yml
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] }}
Expand Down Expand Up @@ -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:
Expand All @@ -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

0 comments on commit d3dbd6e

Please sign in to comment.