-
Notifications
You must be signed in to change notification settings - Fork 35
129 lines (107 loc) · 3.52 KB
/
release.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Release
on:
release:
types: [published]
jobs:
release-ubuntu:
name: Ubuntu release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout tags
shell: bash
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: setup.py
- name: Install twine
run: |
python -m pip install --upgrade pip
pip install twine
- name: Build manylinux Python wheels
uses: RalfG/[email protected]_x86_64
with:
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38'
build-requirements: '-e . --verbose' # pip args
pre-build-command: 'git config --global --add safe.directory ${GITHUB_WORKSPACE}'
- name: Publish manylinux Python wheels
env:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --username __token__ dist/*-manylinux*.whl
release-osx:
name: MacOS release
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout tags
shell: bash
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: setup.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -e .
# Only publish source package on one OS, to prevent PyPI file conflicts.
# Use MacOS rather than Windows to get LF rather than CRLF line endings
# (useful for Debian source packages), and MacOS rather than Linux, since
# the latter has a different build process.
- name: Build and publish wheel and source distribution
env:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload --username __token__ dist/*.whl dist/*.tar.gz
gh release upload ${{ github.event.release.tag_name }} dist/*.tar.gz
release-windows:
name: Windows release
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout tags
shell: bash
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: setup.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine pyinstaller
pip install -e .
- name: Build and publish wheel
env:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py bdist_wheel
twine upload --username __token__ dist/*.whl
- name: Build and publish standalone executable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pyinstaller nmlc.spec
$archive = "nml-standalone-${{ github.event.release.tag_name }}-win64.zip"
Compress-Archive -Path dist/nmlc.exe, LICENSE, README.md, docs/changelog.txt -DestinationPath $archive
gh release upload ${{ github.event.release.tag_name }} $archive