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: Publish Python Package | |
on: | |
release: | |
types: [created] | |
permissions: | |
actions: write | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: "ghcr.io/amikos-tech/chromadb-ops/chops" | |
jobs: | |
build-n-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
set -e | |
python -m pip install --upgrade pip | |
curl -sSL https://install.python-poetry.org | python3 - | |
shell: bash | |
# - name: Version bump | |
# run: | | |
# set -e | |
# poetry version ${{ github.event.release.tag_name }} | |
# git add ./pyproject.toml | |
# git config --global user.name "Release Bot" | |
# git config --global user.email "[email protected]" | |
# git commit -m "Change version to ${{ github.event.release.tag_name }}" --allow-empty | |
# git push origin HEAD:main | |
# shell: bash | |
- name: Publish package to PyPI | |
run: | | |
set -e | |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} | |
poetry publish -n --build | |
shell: bash | |
build-images: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.IMAGE_NAME }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push release Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: "${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }},${{ env.IMAGE_NAME }}:latest" |