-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (99 loc) · 3.08 KB
/
pythonpackage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Build Python Packages
on:
workflow_dispatch:
workflow_run:
workflows: ["HELICS Version Update"]
branches: [main]
types:
- completed
release:
types: published
push:
# Run this for a push only if one of the Python packages has changes
paths:
- '*-pip/**'
- '.github/workflows/pythonpackage.yml'
# NOTE: These jobs *must* use actions/checkout@v1 for full history,
# or run git fetch --prune --unshallow for versioning to work
jobs:
build-helics_apps:
# No container needed, since the package is version agnostic
runs-on: ${{ matrix.os }}
strategy:
matrix:
id: [linux, macos, win32, win64]
include:
- id: linux
os: ubuntu-latest
- id: macos
os: macos-latest
plat_name: macosx_10_9_intel
- id: win32
os: windows-latest
arch: win32
plat_name: win32
- id: win64
os: windows-latest
arch: win64
plat_name: win_amd64
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
- name: Create wheel
shell: bash
run: |
source ./helics_apps-pip/packaging_scripts/setup-${{ runner.os }}.sh "$(cat HELICS_VERSION)" "${{ matrix.arch }}"
./helics_apps-pip/packaging_scripts/build-${{ runner.os }}.sh "${{ matrix.plat_name }}"
./helics_apps-pip/packaging_scripts/repair-${{ runner.os }}.sh
- uses: actions/upload-artifact@v3
with:
name: apps-python-dist
path: upload-wheelhouse
build-helics_apps-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install -U pip install wheel setuptools cffi
- name: Build sdist
run: |
cd ./helics_apps-pip
python setup.py sdist
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: apps-python-dist
path: helics_apps-pip/dist/*.tar.gz
publish-helics_apps:
needs: [build-helics_apps, build-helics_apps-sdist]
runs-on: ubuntu-latest
if: github.event.action == 'published' || endsWith(github.ref, 'main')
steps:
- name: Get the built packages
uses: actions/download-artifact@v4
with:
name: apps-python-dist
path: dist
- name: Publish package to TestPyPI
if: endsWith(github.ref, 'main')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_helics_apps_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_helics_apps_password }}