-
Notifications
You must be signed in to change notification settings - Fork 82
49 lines (46 loc) · 1.28 KB
/
build-python-sdk.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
name: Build Python SDK
on:
push:
branches: main
pull_request:
branches: "*"
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python-sdk
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Necessary to get tags
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-prod-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- uses: mtkennerly/dunamai-action@v1
with:
env-var: NBD_VERSION
args: --style pep440 --format "{base}.dev{distance}+{commit}"
- name: Install Dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
make install-prod
- name: Build Package
run: |
make build-prod
- name: PYPI Publish Dry Run
run: |
poetry publish --dry-run