-
Notifications
You must be signed in to change notification settings - Fork 168
111 lines (110 loc) · 4.05 KB
/
deploy-mitosheet-mitoinstaller.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
name: Deploy - mitosheet and mitoinstaller
on:
push:
branches:
- dev
- main
jobs:
deploy-mitosheet:
name: Deploy mitosheet
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8]
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/checkout@v2
with:
ref: ${{ steps.extract_branch.outputs.branch }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup Auth for PyPi
run: |
echo -e "[distutils]" >> ~/.pypirc
echo -e "index-servers =" >> ~/.pypirc
echo -e " pypi" >> ~/.pypirc
echo -e " testpypi" >> ~/.pypirc
echo -e "[pypi]" >> ~/.pypirc
echo -e "repository = https://upload.pypi.org/legacy/" >> ~/.pypirc
echo -e "username = __token__" >> ~/.pypirc
echo -e "password = ${{ secrets.PYPI_API_TOKEN }}" >> ~/.pypirc
echo -e "" >> ~/.pypirc
echo -e "[testpypi]" >> ~/.pypirc
echo -e "repository = https://test.pypi.org/legacy/" >> ~/.pypirc
echo -e "username = __token__" >> ~/.pypirc
echo -e "password = ${{ secrets.TEST_PYPI_API_TOKEN }}" >> ~/.pypirc
- name: Setup mitosheet
run: |
cd mitosheet
rm -rf venv
python3 -m venv venv
source venv/bin/activate
python ../deployment/bump_version.py mitosheet ${{ steps.extract_branch.outputs.branch }}
python -m pip install -e ".[deploy]"
jlpm install
jlpm run build
- name: Deploy mitosheet
run: |
cd mitosheet
source venv/bin/activate
python ../deployment/deploy.py ${{ steps.extract_branch.outputs.branch }}
deploy-mitoinstaller:
name: Deploy mitoinstaller
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/checkout@v2
with:
ref: ${{ steps.extract_branch.outputs.branch }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Auth for PyPi
run: |
echo -e "[distutils]" >> ~/.pypirc
echo -e "index-servers =" >> ~/.pypirc
echo -e " pypi" >> ~/.pypirc
echo -e " testpypi" >> ~/.pypirc
echo -e "[pypi]" >> ~/.pypirc
echo -e "repository = https://pypi.python.org/pypi" >> ~/.pypirc
echo -e "username = __token__" >> ~/.pypirc
echo -e "password = ${{ secrets.PYPI_API_TOKEN }}" >> ~/.pypirc
echo -e "" >> ~/.pypirc
echo -e "[testpypi]" >> ~/.pypirc
echo -e "repository = https://test.pypi.org/legacy/" >> ~/.pypirc
echo -e "username = __token__" >> ~/.pypirc
echo -e "password = ${{ secrets.TEST_PYPI_API_TOKEN }}" >> ~/.pypirc
- name: Setup mitoinstaller
run: |
cd mitoinstaller
python3 -m venv venv
source venv/bin/activate
python ../deployment/bump_version.py mitoinstaller ${{ steps.extract_branch.outputs.branch }}
pip install -r requirements.txt
- name: Deploy mitoinstaller on testpypi
if: github.ref == 'refs/heads/dev'
run: |
cd mitoinstaller
source venv/bin/activate
python setup.py sdist upload --repository https://test.pypi.org/legacy/
- name: Deploy mitoinstaller on testpypi
if: github.ref == 'refs/heads/main'
run: |
cd mitoinstaller
source venv/bin/activate
python setup.py sdist upload