chore: Upload Embeddings Doc (#719) #129
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
release: | |
name: Build and publish release of kolena Python package and documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
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: Configure SSH key for docs insiders setup | |
uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- uses: astral-sh/setup-uv@v2 | |
- name: Setup environment | |
run: uv venv && source .venv/bin/activate | |
- name: Fetch tags to enable autoversioning | |
run: git fetch --prune --unshallow --tags | |
- name: Install dependencies | |
run: uv pip install --all-extras -r pyproject.toml | |
- name: Run pre-commit checks | |
run: uvx pre-commit run -a | |
- name: Update package version to PEP 440-compliant release tag | |
run: sed -i "s/0.999.0/$(git describe --tags --abbrev=0)/g" pyproject.toml | |
- name: Build 'kolena' Python package | |
run: uvx hatch build -t sdist | |
- name: Publish 'kolena' documentation to production (S3) | |
run: | | |
./docs/setup_insiders.sh | |
uv run mkdocs build --verbose --strict --config-file mkdocs.insiders.yml | |
aws s3 sync ./site "s3://docs.kolena.io" --delete | |
aws cloudfront create-invalidation --no-cli-pager --distribution-id ${{ secrets.DOC_DISTRIBUTION_ID }} --paths "/*" | |
aws s3 sync ./site "s3://docs.kolena.com" --delete | |
aws cloudfront create-invalidation --no-cli-pager --distribution-id ${{ secrets.DOC_COM_DISTRIBUTION_ID }} --paths "/*" | |
env: | |
DD_RUM_CLIENT_TOKEN: ${{ vars.DD_RUM_CLIENT_TOKEN }} | |
DD_RUM_APPLICATION_ID: ${{ vars.DD_RUM_APPLICATION_ID }} | |
- name: Push 'kolena' dist 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/ | |
skip-existing: true | |
- name: Push 'kolena' dist to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip-existing: true | |
- name: Create GitHub release | |
uses: marvinpinto/action-automatic-releases@v1.2.1 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: false | |
# | |
# backcompat: build and publish 'kolena-client' package | |
# | |
- name: "[backcompat] Build 'kolena-client' package" | |
run: | | |
rm -rf ./dist | |
# 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 | |
uv pip install --all-extras -r pyproject.toml | |
uvx hatch build -t sdist | |
- name: "[backcompat] Install twine for package distribution on CodeArtifact" | |
run: pip install twine | |
- name: "[backcompat] Push 'kolena-client' dist to trunk CodeArtifact" | |
run: | | |
aws codeartifact login --tool twine --domain trunk --domain-owner 328803196297 --repository kolena-client | |
twine upload --skip-existing --repository codeartifact ./dist/kolena_client* | |
- name: "[backcompat] Push 'kolena-client' dist 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/ | |
skip-existing: true | |
- name: "[backcompat] Push 'kolena-client' dist to production CodeArtifact" | |
run: | | |
aws codeartifact login --tool twine --domain production --domain-owner 328803196297 --repository kolena-client | |
twine upload --skip-existing --repository codeartifact ./dist/kolena_client* | |
- name: "[backcompat] Push 'kolena-client' dist to PyPI" | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip-existing: true |