Skip to content

Commit c2c251e

Browse files
Add github action for publishing on releases
1 parent dcaf0d6 commit c2c251e

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

.github/workflows/publish.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# When a release is created on github, publish the groundlight package to our internal pypi repository
2+
# (Similar to https://github.com/positronix-ai/predictors/blob/main/.github/workflows/publish.yaml)
3+
name: publish package
4+
on:
5+
release:
6+
types: [created]
7+
jobs:
8+
publish-python-package:
9+
runs-on: ubuntu-latest
10+
env:
11+
INTERNAL_REPO_URL: https://positronix-723181461334.d.codeartifact.us-west-2.amazonaws.com/pypi/internal/
12+
steps:
13+
- name: install python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.9
17+
- name: install poetry
18+
run: |
19+
pip install -U pip
20+
pip install poetry
21+
- name: configure AWS credentials
22+
uses: aws-actions/configure-aws-credentials@v1
23+
with:
24+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
25+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
26+
aws-region: us-west-2
27+
- name: get code
28+
uses: actions/checkout@v2
29+
- name: build package
30+
run: poetry build
31+
- name: configure poetry and publish
32+
run: |
33+
export POETRY_HTTP_BASIC_INTERNAL_USERNAME=aws
34+
export POETRY_HTTP_BASIC_INTERNAL_PASSWORD=$(aws codeartifact get-authorization-token --domain positronix --query authorizationToken --output text)
35+
poetry config repositories.internal $INTERNAL_REPO_URL
36+
poetry publish -r internal

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ except ApiException as e:
6868

6969
## Development
7070

71-
To re-generate the client code:
71+
The auto-generated SDK code is in the `generated/` directory. To re-generate the client code:
7272

7373
```Bash
7474
$ make generate
@@ -77,8 +77,6 @@ $ make generate
7777
## TODOs
7878

7979
- Tests
80-
- Publish package (so we can do `pip install groundlight` or `poetry add groundlight` outside this repo)
81-
- Do it through github actions on tag, for example
8280
- Improve wrappers around API functions (e.g., so you don't have to call `.body` on a response, or add auto-pagination managers, etc.)
8381
- `with` context manager
8482
- Better auto-generated code docs

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "groundlight"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "Call the Groundlight API from python"
55
authors = ["Groundlight AI <[email protected]>"]
66
packages = [

0 commit comments

Comments
 (0)