Skip to content

Commit 13363c9

Browse files
authored
Merge pull request ERGO-Code#1653 from ERGO-Code/latest
Updates to authentication to PyPi required for publishing highspy
2 parents 50670fd + c77a6c3 commit 13363c9

File tree

11 files changed

+177
-47
lines changed

11 files changed

+177
-47
lines changed

.github/workflows/build-meson.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: build-meson
2+
23
on: [push, pull_request]
34

45
jobs:

.github/workflows/build-mingw.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: build-mingw
22

3-
# on: [push, pull_request]
43
on: [pull_request]
54

65
jobs:

.github/workflows/build-python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: build-python-package
2-
on: [pull_request]
3-
# on: []
2+
3+
on: [push, pull_request]
44

55
concurrency:
66
group: ${{ github.workflow }}-${{ github.ref }}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: build-wheels-push
2+
3+
# on: [push]
4+
5+
on:
6+
release:
7+
types:
8+
- published
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build_wheels:
16+
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
17+
runs-on: ${{ matrix.buildplat[0] }}
18+
environment: pypi
19+
strategy:
20+
# Ensure that a wheel builder finishes even if another fails
21+
fail-fast: false
22+
matrix:
23+
# From NumPy
24+
# Github Actions doesn't support pairing matrix values together, let's improvise
25+
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
26+
buildplat:
27+
- [ubuntu-20.04, manylinux_x86_64]
28+
- [ubuntu-20.04, musllinux_x86_64] # No OpenBlas, no test
29+
- [macos-12, macosx_x86_64]
30+
- [macos-14, macosx_arm64]
31+
- [windows-2019, win_amd64]
32+
python: ["cp38", "cp39","cp310", "cp311","cp312"]
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Build wheels
37+
uses: pypa/[email protected]
38+
env:
39+
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
40+
- uses: actions/upload-artifact@v3
41+
with:
42+
path: ./wheelhouse/*.whl
43+
44+
build_sdist:
45+
name: Build source distribution
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Build sdist
51+
shell: bash -l {0}
52+
run: pipx run build --sdist
53+
54+
- uses: actions/upload-artifact@v3
55+
with:
56+
path: dist/*.tar.gz
57+
58+
# upload_testpypi:
59+
# name: >-
60+
# Publish highspy to TestPyPI
61+
# runs-on: ubuntu-latest
62+
# needs: [build_wheels, build_sdist]
63+
64+
# # upload to PyPI on every tag starting with 'v'
65+
# # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
66+
67+
# environment:
68+
# name: testpypi
69+
# url: https://testpypi.org/p/highspy
70+
71+
# permissions:
72+
# id-token: write # IMPORTANT: mandatory for trusted publishing
73+
# steps:
74+
# - uses: actions/download-artifact@v3
75+
# with:
76+
# # unpacks default artifact into dist/
77+
# # if `name: artifact` is omitted, the action will create extra parent dir
78+
# name: artifact
79+
# path: dist
80+
81+
# - name: Download all
82+
# uses: pypa/gh-action-pypi-publish@release/v1
83+
# with:
84+
# repository-url: https://test.pypi.org/legacy/
85+
86+
upload_pypi:
87+
name: >-
88+
Publish highspy to PyPI
89+
runs-on: ubuntu-latest
90+
needs: [build_wheels, build_sdist]
91+
92+
# upload to PyPI on every tag starting with 'v'
93+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
94+
95+
environment:
96+
name: pypi
97+
url: https://pypi.org/p/highspy
98+
99+
permissions:
100+
id-token: write # IMPORTANT: mandatory for trusted publishing
101+
102+
steps:
103+
- uses: actions/download-artifact@v3
104+
with:
105+
# unpacks default artifact into dist/
106+
# if `name: artifact` is omitted, the action will create extra parent dir
107+
name: artifact
108+
path: dist
109+
110+
- name: Download all
111+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/build-wheels.yml

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
# Python release WIP
2-
name: Build wheels
3-
# on: [push]
1+
name: build-wheels
42

5-
on:
6-
release:
7-
types:
8-
- published
3+
on: [pull_request]
94

105
concurrency:
116
group: ${{ github.workflow }}-${{ github.ref }}
@@ -15,7 +10,6 @@ jobs:
1510
build_wheels:
1611
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
1712
runs-on: ${{ matrix.buildplat[0] }}
18-
environment: pypi
1913
strategy:
2014
# Ensure that a wheel builder finishes even if another fails
2115
fail-fast: false
@@ -27,7 +21,7 @@ jobs:
2721
- [ubuntu-20.04, manylinux_x86_64]
2822
- [ubuntu-20.04, musllinux_x86_64] # No OpenBlas, no test
2923
- [macos-12, macosx_x86_64]
30-
- [macos-12, macosx_arm64]
24+
- [macos-14, macosx_arm64]
3125
- [windows-2019, win_amd64]
3226
python: ["cp38", "cp39","cp310", "cp311","cp312"]
3327

@@ -37,9 +31,6 @@ jobs:
3731
uses: pypa/[email protected]
3832
env:
3933
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
40-
- uses: actions/upload-artifact@v3
41-
with:
42-
path: ./wheelhouse/*.whl
4334

4435
build_sdist:
4536
name: Build source distribution
@@ -50,27 +41,3 @@ jobs:
5041
- name: Build sdist
5142
shell: bash -l {0}
5243
run: pipx run build --sdist
53-
54-
- uses: actions/upload-artifact@v3
55-
with:
56-
path: dist/*.tar.gz
57-
58-
upload_pypi:
59-
needs: [build_wheels, build_sdist]
60-
runs-on: ubuntu-latest
61-
# upload to PyPI on every tag starting with 'v'
62-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
63-
# alternatively, to publish when a GitHub Release is created, use the following rule:
64-
# if: github.event_name == 'release' && github.event.action == 'published'
65-
steps:
66-
- uses: actions/download-artifact@v3
67-
with:
68-
# unpacks default artifact into dist/
69-
# if `name: artifact` is omitted, the action will create extra parent dir
70-
name: artifact
71-
path: dist
72-
73-
- uses: pypa/gh-action-pypi-publish@release/v1
74-
with:
75-
user: __token__
76-
password: ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: check-python-package
2+
3+
on: [pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Build sdist
16+
run: |
17+
python3 -m pip install build setuptools twine
18+
python3 -m build --sdist
19+
python3 -m build --wheel
20+
twine check dist/*
21+
22+
build_mac:
23+
runs-on: macos-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Build sdist
28+
run: |
29+
python3 -m pip install build setuptools twine
30+
python3 -m build --sdist
31+
python3 -m build --wheel
32+
twine check dist/*
33+
34+
build_win:
35+
runs-on: windows-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Install correct python version
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: 3.9
43+
44+
- name: Build sdist
45+
run: |
46+
py -m pip install build setuptools twine
47+
py -m build --sdist
48+
py -m build --wheel
49+
py -m twine check dist/*

.github/workflows/sanitizers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
meson setup bddir -Duse_zlib=enabled -Dwith_tests=True -Db_sanitize=${{ matrix.sanitizer }}
3737
meson test -C bddir -t 10 # Time x10 for the tests
3838
- name: Upload log
39-
uses: actions/upload-artifact@v3
39+
uses: actions/upload-artifact@v4
4040
if: always()
4141
with:
4242
name: log_${{ matrix.sanitizer }}_${{ matrix.os }}.txt

.github/workflows/test-python-macos.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: test-python-macos
22

3-
on: [push]
4-
#on: [push, pull_request]
3+
on: [push, pull_request]
54

65
jobs:
76
build:

.github/workflows/test-python-ubuntu.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: test-python-ubuntu
22

3-
on: [push]
4-
#on: [push, pull_request]
3+
on: [push, pull_request]
54

65
jobs:
76
build:

.github/workflows/test-python-win.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: test-python-win
22

3-
on: [push]
4-
#on: [push, pull_request]
3+
on: [push, pull_request]
54

65
jobs:
76
build:

0 commit comments

Comments
 (0)