Skip to content

Commit 7df88b4

Browse files
author
Brandon Meyerowitz
committed
fix: add ci to python sdk (#1)
1 parent d99c4e6 commit 7df88b4

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- "**"
6+
pull_request:
7+
branches:
8+
- "**"
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up Python
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: "3.x"
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install build requests sseclient-py python-dotenv pytest
23+
- name: Build package
24+
run: python -m build
25+
- name: Run Tests
26+
env:
27+
CB_PROJECT_ID: ${{ secrets.CB_PROJECT_ID }}
28+
run: pytest
29+
30+
release:
31+
runs-on: ubuntu-latest
32+
needs: build
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Set up Python
36+
uses: actions/setup-python@v3
37+
with:
38+
python-version: "3.x"
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install build
43+
- uses: go-semantic-release/action@v1
44+
id: semrel
45+
with:
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
allow-initial-development-versions: true
48+
- name: Set version number
49+
if: steps.semrel.outputs.version != ''
50+
run: sed -i -e 's/version = "0.0.0"/version = "${{ steps.semrel.outputs.version }}"/g' ./pyproject.toml
51+
- name: Build package
52+
if: steps.semrel.outputs.version != ''
53+
run: python -m build
54+
- name: Publish package
55+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
56+
if: steps.semrel.outputs.version != ''
57+
with:
58+
user: __token__
59+
password: ${{ secrets.PYPI_API_TOKEN }}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "Commonbase Python SDK"
88
readme = "README.md"
99
license.file = "LICENSE"
1010
requires-python = ">=3.8"
11-
version = "0.1.4"
11+
version = "0.0.0"
1212
dependencies = ["requests>=2.31.0", "sseclient-py>=1.7.2"]
1313
urls.Homepage = "https://github.com/commonbaseapp/commonbase-python"
1414
urls.Source = "https://github.com/commonbaseapp/commonbase-python"

0 commit comments

Comments
 (0)