-
Notifications
You must be signed in to change notification settings - Fork 2
104 lines (83 loc) · 2.37 KB
/
release.yml
File metadata and controls
104 lines (83 loc) · 2.37 KB
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
name: Release
# Most parts are borrowed from https://github.com/pola-rs/polars/blob/main/.github/workflows/release-python.yml
on:
workflow_dispatch:
inputs:
# Latest commit to include with the release. If omitted, use the latest commit on the main branch.
sha:
description: Commit SHA
type: string
# Create the sdist and build the wheels, but do not publish to PyPI / GitHub.
dry-run:
description: Dry run
type: boolean
default: false
env:
PYTHON_VERSION: '3.11'
defaults:
run:
shell: bash
jobs:
create-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Create source distribution
run: python setup.py sdist
- name: Test sdist
run: |
pip install --force-reinstall --verbose dist/*.tar.gz
python -c 'import ingestify'
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist-ingestify
path: dist/*.tar.gz
build-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install wheel
run: pip install wheel
- name: Build wheel
run: python setup.py bdist_wheel
- name: Test wheel
run: |
pip install --force-reinstall --verbose dist/*.whl
python -c 'import ingestify'
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-ingestify
path: dist/*.whl
publish-to-pypi:
needs: [create-sdist, build-wheel]
environment:
name: release-python
url: https://pypi.org/project/ingestify
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download sdists and wheels
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish to PyPI
if: inputs.dry-run == false
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true