forked from delta-io/delta-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (122 loc) · 4.3 KB
/
python_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
130
131
132
133
134
135
136
137
138
139
140
141
name: Release to PyPI
on:
push:
tags: [ 'python-v*' ]
defaults:
run:
working-directory: ./python
jobs:
validate-release-tag:
name: Validate git tag
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: compare git tag with cargo metadata
run: |
PUSHED_TAG=${GITHUB_REF##*/}
CURR_VER=$( grep version Cargo.toml | head -n 1 | awk '{print $3}' | tr -d '"' )
if [[ "${PUSHED_TAG}" != "python-v${CURR_VER}" ]]; then
echo "Cargo metadata has version set to ${CURR_VER}, but got pushed tag ${PUSHED_TAG}."
exit 1
fi
release-pypi-mac-windows:
needs: validate-release-tag
name: PyPI release Mac & Windows
strategy:
fail-fast: false
matrix:
os:
- macOS-10.15
- windows-2019
include:
- target: x86_64-apple-darwin
os: macOS-10.15
- target: x86_64-pc-windows-msvc
os: windows-2019
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.target }}
- uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Setup
run: make setup
- name: Publish to pypi (without sdist)
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: make publish TARGET="${{ matrix.target }}" EXTRA_ARGS="--no-sdist"
release-pypi-manylinux:
needs: validate-release-tag
name: PyPI release manylinux
runs-on: ubuntu-20.04
container: quay.io/pypa/manylinux2010_x86_64:2020-12-31-4928808
steps:
# actions/checkout@v2 is a node action, which runs on a fairly new
# version of node. however, manylinux environment's glibc is too old for
# that version of the node. so we will have to use v1 instead, which is a
# docker based action.
- uses: actions/checkout@v1
# Require for building openssl-sys
- name: Install perl-IPC/Cmd
run: yum install -y perl-IPC-Cmd
# actions-rs/toolchain@v1 is a node action, which runs on a fairly new
# version of node. however, manylinux environment's glibc is too old for
# that version of the node. so we will have to install rust manually here.
- name: Install Rust
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
$HOME/.cargo/bin/rustup default stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Enable manylinux Python targets
run: |
echo "/opt/python/cp36-cp36m/bin" >> $GITHUB_PATH
- name: Setup
run: make setup
- name: Publish manylinux to pypi (without sdist)
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# linux build uploads sdist to update projection description on PyPI
run: make publish TARGET="x86_64-unknown-linux-gnu" EXTRA_ARGS=""
release-docs:
needs: [validate-release-tag, release-pypi-manylinux, release-pypi-mac-windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch full history for gh-pages branch checkout
- name: Install minimal stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: stable
override: true
- name: Build and install deltalake
run: |
make install MATURIN_EXTRA_ARGS="--manylinux off"
- name: Build Sphinx documentation
run: |
make build-documentation
mv docs/build ~/build
echo "Configuring git..."
git config --global user.name 'Github Action'
git config --global user.email 'deltars@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
echo "Commit to gh-pages branch..."
git reset --hard HEAD
git clean -d -fx .
git checkout gh-pages
cd ..
cp -avr ~/build/html/. ./python
PUSHED_TAG=${GITHUB_REF##*/}
git status
git add ./python
git commit -m "doc update for tag `${PUSHED_TAG}`"
git push origin gh-pages