Skip to content

Commit

Permalink
Add github action for publishing on releases
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-groundlight committed May 6, 2022
1 parent dcaf0d6 commit c2c251e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# When a release is created on github, publish the groundlight package to our internal pypi repository
# (Similar to https://github.com/positronix-ai/predictors/blob/main/.github/workflows/publish.yaml)
name: publish package
on:
release:
types: [created]
jobs:
publish-python-package:
runs-on: ubuntu-latest
env:
INTERNAL_REPO_URL: https://positronix-723181461334.d.codeartifact.us-west-2.amazonaws.com/pypi/internal/
steps:
- name: install python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: install poetry
run: |
pip install -U pip
pip install poetry
- name: configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: get code
uses: actions/checkout@v2
- name: build package
run: poetry build
- name: configure poetry and publish
run: |
export POETRY_HTTP_BASIC_INTERNAL_USERNAME=aws
export POETRY_HTTP_BASIC_INTERNAL_PASSWORD=$(aws codeartifact get-authorization-token --domain positronix --query authorizationToken --output text)
poetry config repositories.internal $INTERNAL_REPO_URL
poetry publish -r internal
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ except ApiException as e:

## Development

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

```Bash
$ make generate
Expand All @@ -77,8 +77,6 @@ $ make generate
## TODOs

- Tests
- Publish package (so we can do `pip install groundlight` or `poetry add groundlight` outside this repo)
- Do it through github actions on tag, for example
- Improve wrappers around API functions (e.g., so you don't have to call `.body` on a response, or add auto-pagination managers, etc.)
- `with` context manager
- Better auto-generated code docs
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "groundlight"
version = "0.1.1"
version = "0.1.2"
description = "Call the Groundlight API from python"
authors = ["Groundlight AI <[email protected]>"]
packages = [
Expand Down

0 comments on commit c2c251e

Please sign in to comment.