-
Notifications
You must be signed in to change notification settings - Fork 12
62 lines (50 loc) · 1.76 KB
/
release.yml
File metadata and controls
62 lines (50 loc) · 1.76 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
name: Release to PyPi
on:
workflow_dispatch:
inputs:
version:
description: 'version override'
required: false
repository_dispatch:
types: [release-python]
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
VERSION_OVERRIDE: ${{ github.event.inputs.version }}
jobs:
test-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
pip install build twine pytest pyarrow pandas
- name: Set version
run: |
# Get version from latest release or use override
if [[ $VERSION_OVERRIDE ]]; then
echo $VERSION_OVERRIDE > sling/VERSION
else
# Get latest version from GitHub releases
LATEST_VERSION=$(curl -s https://api.github.com/repos/slingdata-io/sling-cli/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/^v//')
echo $LATEST_VERSION > sling/VERSION
fi
echo "Version set to: $(cat sling/VERSION)"
- name: Run tests
run: |
cd sling
# Install sling package in development mode
pip install -e .
# Run the tests
python -m pytest tests/tests.py -v
SLING_USE_ARROW=false python -m pytest tests/test_sling_class.py -v
SLING_USE_ARROW=true python -m pytest tests/test_sling_class.py -v
- name: Build and release sling to PyPi
run: |
cp README.md sling/
cd sling
python -m build && twine upload --verbose --skip-existing dist/*