-
Notifications
You must be signed in to change notification settings - Fork 63
121 lines (118 loc) · 4.53 KB
/
poetry-publish.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
name: poetry-publish
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish-test-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1
- name: Cache Poetry virtualenv
uses: actions/cache@v1
id: cache
with:
path: ~/.virtualenvs
key: poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('pyproject.toml') }}
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }}
- name: Install Dependencies
run: |
poetry install -E gateway -E solver -E aws -E azure -E gcp
poetry run pip install -r requirements-dev.txt
- name: Build package
run: |
export SKYPLANEVERSION=`poetry version | awk 'END {print $NF}'`
echo "gateway_version = '$SKYPLANEVERSION'" > skyplane/gateway_version.py
poetry build
- name: Publish package (dry run)
run: poetry publish -r test-pypi --dry-run
- name: Publish package
run: poetry publish -r test-pypi
publish-pypi-dev:
runs-on: ubuntu-latest
needs: publish-test-pypi
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1
- name: Cache Poetry virtualenv
uses: actions/cache@v1
id: cache
with:
path: ~/.virtualenvs
key: poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('pyproject.toml') }}
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
- name: Install Dependencies
run: |
poetry install -E gateway -E solver -E aws -E azure -E gcp
poetry run pip install -r requirements-dev.txt
- name: Build package under skyplane-dev name
run: |
sed -i 's/name = "skyplane"/name = "skyplane-dev"/g' pyproject.toml
export SKYPLANEVERSION=`poetry version | awk 'END {print $NF}'`
echo "gateway_version = '$SKYPLANEVERSION'" > skyplane/gateway_version.py
poetry build
- name: Publish package (dry run)
run: poetry publish --dry-run
- name: Publish package
run: poetry publish
publish-pypi:
runs-on: ubuntu-latest
needs: publish-pypi-dev
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 - --version 1.4.0
- name: Cache Poetry virtualenv
uses: actions/cache@v1
id: cache
with:
path: ~/.virtualenvs
key: poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('pyproject.toml') }}
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
- name: Install Dependencies
run: |
poetry install -E gateway -E solver -E aws -E azure -E gcp
poetry run pip install -r requirements-dev.txt
- name: Build package under skyplane name
run: |
export SKYPLANEVERSION=`poetry version | awk 'END {print $NF}'`
echo "gateway_version = '$SKYPLANEVERSION'" > skyplane/gateway_version.py
poetry build
- name: Publish package (dry run)
run: poetry publish --dry-run
- name: Publish package
run: poetry publish