-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into gh/pin-urllib3
- Loading branch information
Showing
8 changed files
with
63 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,12 @@ on: | |
branches: | ||
- does-not-exist | ||
# TODO: uncomment once repository tags are set up properly | ||
# - trunk | ||
# tags: | ||
# - "*" | ||
|
||
jobs: | ||
build: | ||
name: Build and publish kolena-client Python package and documentation | ||
name: Build and publish kolena Python package and documentation | ||
env: | ||
ASSET_BUCKET: kolena-client-assets | ||
runs-on: ubuntu-latest | ||
|
@@ -21,39 +20,46 @@ jobs: | |
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
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: Install Poetry | ||
run: pip install poetry==1.2.2 | ||
|
||
- name: Fetch tags to enable autoversioning | ||
run: git fetch --prune --unshallow --tags | ||
- name: Update kolena-client package version to PEP 440-compliant dev tag | ||
if: github.ref_type != 'tag' | ||
run: | | ||
LATEST_TAG=$(git describe --tags --abbrev=0) | ||
COMMITS_SINCE_TAG=$(git rev-list $LATEST_TAG..HEAD --count) | ||
poetry version $LATEST_TAG.dev$COMMITS_SINCE_TAG | ||
- name: Update kolena-client package version to PEP 440-compliant production release tag | ||
if: github.ref_type == 'tag' | ||
|
||
- name: Update kolena package version to PEP 440-compliant production release tag | ||
run: poetry version $(git describe --tags --abbrev=0) | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Run pre-commit checks | ||
run: poetry run pre-commit run -a | ||
- name: Build client Python package | ||
|
||
- name: Build 'kolena' Python package | ||
run: poetry build --format=sdist | ||
|
||
- name: Build 'kolena-client' package for backwards compatibility | ||
run: | | ||
# update first instance of 'kolena' to 'kolena-client' in pyproject.toml, kolena/__init__.py (package name) | ||
sed -i '0,/kolena/{s/kolena/kolena-client/}' pyproject.toml kolena/__init__.py | ||
poetry build --format=sdist | ||
- name: Build client documentation and push to S3 | ||
if: github.ref_type == 'tag' | ||
run: | | ||
./render.sh | ||
VERSION=$(poetry run python3 -c "import importlib.metadata; print(importlib.metadata.version('kolena-client'))") | ||
VERSION=$(poetry run python3 -c "import kolena; print(kolena.__version__)") | ||
BUCKET_PATH="s3://$ASSET_BUCKET/docs/$VERSION" | ||
echo "pushing documentation to '$BUCKET_PATH'..." | ||
|
@@ -65,19 +71,33 @@ jobs: | |
aws s3 rm --recursive "$BUCKET_PATH" | ||
aws s3 sync ./build "$BUCKET_PATH" | ||
working-directory: ./docs | ||
- name: Install twine for package distribution | ||
|
||
- name: Push kolena, kolena-client dists to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
- name: Push kolena, kolena-client dists to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
- name: Install twine for package distribution on CodeArtifact | ||
run: pip3 install twine | ||
- name: Push client dist to trunk CodeArtifact | ||
|
||
- name: Push kolena-client dist to trunk CodeArtifact for backwards compatibility | ||
run: | | ||
aws codeartifact login --tool twine --domain trunk --domain-owner 328803196297 --repository kolena-client | ||
twine upload --skip-existing --repository codeartifact ./dist/* | ||
- name: Push client dist to production CodeArtifact | ||
if: github.ref_type == 'tag' | ||
twine upload --skip-existing --repository codeartifact ./dist/kolena_client* | ||
working-directory: ${{ env.working-directory }} | ||
|
||
- name: Push kolena-client dist to production CodeArtifact for backwards compatibility | ||
run: | | ||
aws codeartifact login --tool twine --domain production --domain-owner 328803196297 --repository kolena-client | ||
twine upload --skip-existing --repository codeartifact ./dist/* | ||
- name: Create GitHub release with kolena-client build as artifact | ||
if: github.ref_type == 'tag' | ||
twine upload --skip-existing --repository codeartifact ./dist/kolena_cilent* | ||
- name: Create GitHub release with kolena build as artifact | ||
uses: marvinpinto/[email protected] | ||
with: | ||
repo_token: ${{ secrets.RELEASE_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = "kolena-client" | ||
project = "kolena" | ||
copyright = f"{datetime.now().year} Kolena. All rights reserved" | ||
author = "Kolena Engineering <[email protected]>" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
# | ||
# (robots do not like this file) | ||
|
||
__name__ = "kolena-client" | ||
__name__ = "kolena" | ||
__version__: str | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[tool.poetry] | ||
name = "kolena-client" | ||
name = "kolena" | ||
version = "0.999.0" | ||
description = "Client for Kolena's machine learning (ML) testing and debugging platform." | ||
authors = ["Kolena Engineering <[email protected]>"] | ||
|