-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (66 loc) · 1.82 KB
/
build-python-package.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
name: Build python package
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels for ${{ matrix.platform-id }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
platform-id: manylinux_x86_64
- os: windows-2019
platform-id: win_amd64
- os: macos-latest
platform-id: macosx_x86_64
- os: macos-latest
platform-id: macosx_arm64
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp38-${{ matrix.platform-id }}
CIBW_ARCHS: all
CIBW_TEST_SKIP: '*-macosx_arm64'
- uses: actions/upload-artifact@v3
if: github.event_name == 'push'
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build sdist
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Build sdist
run: |
python -m pip install build scikit-build-core
python -m build --sdist --outdir dist
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz
upload_artifacts:
name: 'Upload to PyPI'
if: github.repository == 'Nixtla/coreforecast' && startsWith(github.ref, 'refs/tags/v')
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1