-
Notifications
You must be signed in to change notification settings - Fork 8
171 lines (126 loc) · 5.15 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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:
release-python:
# runs-on: [self-hosted, Linux]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Pip Install
run: |
pip install twine
- name: Release sling-linux-amd64 to PyPi
run: |
export BASE_FOLDER=sling_base/sling-linux-amd64
export BIN_FOLDER=$BASE_FOLDER/sling_linux_amd64/bin
mkdir -p $BIN_FOLDER
cd $BIN_FOLDER
wget -q 'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_linux_amd64.tar.gz'
tar xf sling_linux_amd64.tar.gz
mv sling sling-linux-amd64
rm -f *.tar.gz
cd -
chmod -R 755 $BIN_FOLDER
export SLING_VERSION=$( $BIN_FOLDER/sling-linux-amd64 --version | sed 's/Version: //')
echo $SLING_VERSION > $BIN_FOLDER/VERSION
if [[ $VERSION_OVERRIDE ]]
then
echo $VERSION_OVERRIDE > $BIN_FOLDER/VERSION
fi
cp README.md $BASE_FOLDER/
cd sling_base/sling-linux-amd64
pip install -e .
python setup.py sdist && twine upload --verbose --skip-existing dist/*
- name: Release sling-linux-arm64 to PyPi
run: |
export BASE_FOLDER=sling_base/sling-linux-arm64
export BIN_FOLDER=$BASE_FOLDER/sling_linux_arm64/bin
mkdir -p $BIN_FOLDER
cd $BIN_FOLDER
wget -q 'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_linux_arm64.tar.gz'
tar xf sling_linux_arm64.tar.gz
mv sling sling-linux-arm64
rm -f *.tar.gz
cd -
chmod -R 755 $BIN_FOLDER
export SLING_VERSION=$( sling_base/sling-linux-amd64/sling_linux_amd64/bin/sling-linux-amd64 --version | sed 's/Version: //')
echo $SLING_VERSION > $BIN_FOLDER/VERSION
if [[ $VERSION_OVERRIDE ]]
then
echo $VERSION_OVERRIDE > $BIN_FOLDER/VERSION
fi
cp README.md $BASE_FOLDER/
cd $BASE_FOLDER
pip install -e .
python setup.py sdist && twine upload --verbose --skip-existing dist/*
- name: Release sling-mac-universal to PyPi
run: |
export BASE_FOLDER=sling_base/sling-mac-universal
export BIN_FOLDER=$BASE_FOLDER/sling_mac_universal/bin
mkdir -p $BIN_FOLDER
cd $BIN_FOLDER
wget -q 'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_darwin_all.tar.gz'
tar xf sling_darwin_all.tar.gz
mv sling sling-mac
rm -f *.tar.gz
cd -
chmod -R 755 $BIN_FOLDER
export SLING_VERSION=$( sling_base/sling-linux-amd64/sling_linux_amd64/bin/sling-linux-amd64 --version | sed 's/Version: //')
echo $SLING_VERSION > $BIN_FOLDER/VERSION
if [[ $VERSION_OVERRIDE ]]
then
echo $VERSION_OVERRIDE > $BIN_FOLDER/VERSION
fi
cp README.md $BASE_FOLDER/
cd $BASE_FOLDER
pip install -e .
python setup.py sdist && twine upload --verbose --skip-existing dist/*
- name: Release sling-windows-amd64 to PyPi
run: |
export BASE_FOLDER=sling_base/sling-windows-amd64
export BIN_FOLDER=$BASE_FOLDER/sling_windows_amd64/bin
mkdir -p $BIN_FOLDER
cd $BIN_FOLDER
wget -q 'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_windows_amd64.tar.gz'
tar xf sling_windows_amd64.tar.gz
mv sling.exe sling-win-amd64.exe
rm -f *.tar.gz
cd -
chmod -R 755 $BIN_FOLDER
export SLING_VERSION=$( sling_base/sling-linux-amd64/sling_linux_amd64/bin/sling-linux-amd64 --version | sed 's/Version: //')
echo $SLING_VERSION > $BIN_FOLDER/VERSION
if [[ $VERSION_OVERRIDE ]]
then
echo $VERSION_OVERRIDE > $BIN_FOLDER/VERSION
fi
cp README.md $BASE_FOLDER/
cd $BASE_FOLDER
pip install -e .
python setup.py sdist && twine upload --verbose --skip-existing dist/*
- name: Release sling to PyPi
run: |
export SLING_VERSION=$( sling_base/sling-linux-amd64/sling_linux_amd64/bin/sling-linux-amd64 --version | sed 's/Version: //')
echo $SLING_VERSION > sling/VERSION
if [[ $VERSION_OVERRIDE ]]
then
echo $VERSION_OVERRIDE > sling/VERSION
fi
cp README.md sling/
cd sling
pip install -e .
python setup.py sdist && twine upload --verbose --skip-existing dist/*