release: v0.4.2-rc9 #84
Workflow file for this run
This file contains hidden or 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: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| jobs: | |
| agents: | |
| runs-on: ubuntu-latest | |
| environment: release | |
| strategy: | |
| matrix: | |
| agent: | |
| - chat | |
| - rag | |
| - form | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: version | |
| run: | | |
| echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| echo "latestTag=$([[ ${GITHUB_REF#refs/tags/v} =~ [a-zA-Z] ]] && echo prerelease || echo latest)" >> $GITHUB_OUTPUT | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./agents/${{ matrix.agent }}/Dockerfile | |
| push: false | |
| load: true | |
| build-args: | | |
| RELEASE_VERSION=${{ github.ref_name }} | |
| tags: tmp-agent-image | |
| cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:cache | |
| cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:cache,mode=max | |
| - id: agent-manifest | |
| run: | | |
| set -e | |
| docker run -d --rm --name=tmp-agent -p 8000:8000 -e HOST=0.0.0.0 -e PORT=8000 tmp-agent-image | |
| success=0 | |
| for i in {1..30}; do | |
| echo "Extracting manifest: attempt $i" | |
| response=$(curl http://localhost:8000/.well-known/agent-card.json 2>/dev/null) && success=1 && break | |
| sleep 0.5 | |
| done | |
| [[ "$success" == 1 ]] || (echo "Failed to discover agents" && exit 1) | |
| docker kill tmp-agent | |
| AGENT_MANIFEST=$(echo "$response" | base64 -w 0) | |
| echo "content=$AGENT_MANIFEST" >> $GITHUB_OUTPUT | |
| - uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./agents/${{ matrix.agent }}/Dockerfile | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| build-args: | | |
| RELEASE_VERSION=${{ github.ref_name }} | |
| tags: | | |
| ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:${{ github.sha }} | |
| ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:${{ steps.version.outputs.version }} | |
| ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:${{ steps.version.outputs.latestTag }} | |
| labels: | | |
| beeai.dev.agent.json=${{ steps.agent-manifest.outputs.content }} | |
| cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:cache | |
| cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:cache,mode=max | |
| agentstack: | |
| needs: agents | |
| runs-on: ubuntu-latest | |
| environment: release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| HELM_EXPERIMENTAL_OCI: '1' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: version | |
| run: | | |
| echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| echo "latestTag=$([[ ${GITHUB_REF#refs/tags/v} =~ [a-zA-Z] ]] && echo prerelease || echo latest)" >> $GITHUB_OUTPUT | |
| VERSION="${GITHUB_REF#refs/tags/v}" | |
| if [[ "$VERSION" =~ [Rr][Cc] ]]; then | |
| echo "npmTag=rc" >> $GITHUB_OUTPUT | |
| else | |
| echo "npmTag=latest" >> $GITHUB_OUTPUT | |
| fi | |
| - uses: ./.github/actions/setup | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: "Set up QEMU" # required by [agentstack-cli:build] | |
| id: "setup-qemu" | |
| shell: bash | |
| run: | | |
| set -eux -o pipefail | |
| [ "$(uname)" = "Linux" ] | |
| [ "$(uname -m)" = "x86_64" ] | |
| sudo apt-get update -qq | |
| sudo apt-get install -qqy --no-install-recommends ovmf qemu-system-x86 qemu-utils | |
| sudo modprobe kvm | |
| # `sudo usermod -aG kvm $(whoami)` does not take an effect on GHA | |
| sudo chown $(whoami) /dev/kvm | |
| - run: mise run common:check:version | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - run: mise run 'agentstack-server:build:*' | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: ./apps/agentstack-server | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}/agentstack-server:${{ github.sha }} | |
| ghcr.io/${{ github.repository }}/agentstack-server:${{ steps.version.outputs.version }} | |
| ghcr.io/${{ github.repository }}/agentstack-server:${{ steps.version.outputs.latestTag }} | |
| cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/agentstack-server:cache | |
| cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/agentstack-server:cache,mode=max | |
| - run: mise run 'agentstack-ui:build:*' | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./apps/agentstack-ui/Dockerfile | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| ghcr.io/${{ github.repository }}/agentstack-ui:${{ github.sha }} | |
| ghcr.io/${{ github.repository }}/agentstack-ui:${{ steps.version.outputs.version }} | |
| ghcr.io/${{ github.repository }}/agentstack-ui:${{ steps.version.outputs.latestTag }} | |
| cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/agentstack-ui:cache | |
| cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/agentstack-ui:cache,mode=max | |
| - run: mise run helm:build | |
| - run: echo '${{ secrets.GITHUB_TOKEN }}' | helm registry login --username '${{ github.actor }}' --password-stdin ghcr.io | |
| - run: helm push ./helm/dist/agentstack-*.tgz 'oci://ghcr.io/${{ github.repository }}/chart' | |
| - run: mise run agentstack-sdk-py:build | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: apps/agentstack-sdk-py/dist | |
| - run: mise run agentstack-cli:build | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: apps/agentstack-cli/dist | |
| - name: Publish TS SDK | |
| working-directory: apps/agentstack-sdk-ts | |
| run: npm publish --tag ${{ steps.version.outputs.npmTag }} |