diff --git a/.github/docs/release.md b/.github/docs/release.md new file mode 100644 index 000000000..492643359 --- /dev/null +++ b/.github/docs/release.md @@ -0,0 +1,31 @@ +## How to make a release + +### Dev release + +#### Prepare release +1. Set the project version that will be released in [pyproject.toml](https://github.com/topoteretes/cognee/blob/dev/pyproject.toml#L4) +2. Update `uv.locl` with `uv lock` lock command +3. Create a PR `dev` and merge it. + +#### Perform Release +1. Go to [Release action](https://github.com/topoteretes/cognee/actions/workflows/release.yml) +2. Select `dev` branch and run the workflow. +3. Whatch the logs and make sure that everything goes well + +### Main release + +#### Prepare release +1. Set the project version that will be released in [pyproject.toml](https://github.com/topoteretes/cognee/blob/dev/pyproject.toml#L4) +2. Update `uv.locl` with `uv lock` lock command +3. Create a PR `main` and merge it. + +#### Perform Release +1. Go to [Release action](https://github.com/topoteretes/cognee/actions/workflows/release.yml) +2. Select `main` branch and run the workflow. +3. Whatch the logs and make sure that everything goes well + +### Release validation + +1. Make sure that the correct image is published to [Docker Hub](https://hub.docker.com/r/cognee/cognee) +2. Python package is published to [PyPi](https://pypi.org/project/cognee/) +3. Find the created github release in [GitHub releases](https://github.com/topoteretes/cognee/releases). Edit/prettify the release notes if required. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84601edf7..226b0624e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,19 +1,10 @@ name: release.yml on: workflow_dispatch: - inputs: - flavour: - required: true - default: dev - type: choice - options: - - dev - - main - description: Dev or Main release jobs: release-github: - name: Create GitHub Release from ${{ inputs.flavour }} + name: Create GitHub Release from ${{ github.ref_name }} outputs: tag: ${{ steps.create_tag.outputs.tag }} version: ${{ steps.create_tag.outputs.version }} @@ -22,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check out ${{ inputs.flavour }} + - name: Check out ${{ github.ref_name }} uses: actions/checkout@v4 with: - ref: ${{ inputs.flavour }} + ref: ${{ github.ref_name }} - name: Install uv uses: astral-sh/setup-uv@v7 @@ -42,10 +33,10 @@ jobs: echo "tag=${TAG}" >> "$GITHUB_OUTPUT" echo "version=${VERSION}" >> "$GITHUB_OUTPUT" - + git tag "${TAG}" git push origin "${TAG}" - + - name: Create GitHub Release uses: softprops/action-gh-release@v2 @@ -54,49 +45,49 @@ jobs: generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - release-pypi-package: + + release-pypi-package: needs: release-github - name: Release PyPI Package from ${{ inputs.flavour }} + name: Release PyPI Package from ${{ github.ref_name }} permissions: contents: read runs-on: ubuntu-latest steps: - - name: Check out ${{ inputs.flavour }} + - name: Check out ${{ github.ref_name }} uses: actions/checkout@v4 with: - ref: ${{ inputs.flavour }} - + ref: ${{ github.ref_name }} + - name: Install uv uses: astral-sh/setup-uv@v7 - + - name: Install Python run: uv python install - + - name: Install dependencies run: uv sync --locked --all-extras - + - name: Build distributions run: uv build - - - name: Publish ${{ inputs.flavour }} release to PyPI + + - name: Publish ${{ github.ref_name }} release to PyPI env: UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} run: uv publish - - release-docker-image: + + release-docker-image: needs: release-github - name: Release Docker Image from ${{ inputs.flavour }} + name: Release Docker Image from ${{ github.ref_name }} permissions: contents: read runs-on: ubuntu-latest steps: - - name: Check out ${{ inputs.flavour }} + - name: Check out ${{ github.ref_name }} uses: actions/checkout@v4 with: - ref: ${{ inputs.flavour }} + ref: ${{ github.ref_name }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -108,7 +99,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push Dev Docker Image - if: ${{ inputs.flavour == 'dev' }} + if: ${{ github.ref_name == 'dev' }} uses: docker/build-push-action@v5 with: context: . @@ -117,22 +108,22 @@ jobs: tags: cognee/cognee:${{ needs.release-github.outputs.version }} labels: | version=${{ needs.release-github.outputs.version }} - flavour=${{ inputs.flavour }} + flavour=${{ github.ref_name }} cache-from: type=registry,ref=cognee/cognee:buildcache cache-to: type=registry,ref=cognee/cognee:buildcache,mode=max - name: Build and push Main Docker Image - if: ${{ inputs.flavour == 'main' }} + if: ${{ github.ref_name == 'main' }} uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/arm64 push: true - tags: | + tags: | cognee/cognee:${{ needs.release-github.outputs.version }} cognee/cognee:latest labels: | version=${{ needs.release-github.outputs.version }} - flavour=${{ inputs.flavour }} + flavour=${{ github.ref_name }} cache-from: type=registry,ref=cognee/cognee:buildcache cache-to: type=registry,ref=cognee/cognee:buildcache,mode=max diff --git a/.gitignore b/.gitignore index ff42efc97..787ce3921 100644 --- a/.gitignore +++ b/.gitignore @@ -197,3 +197,5 @@ SWE-bench_testsample/ # ChromaDB Data .chromadb_data/ + +deployment/helm/values-local.yml