Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 15 additions & 54 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@ name: Create and Publish Release

on:
push:
branches:
- main
tags:
- 'v*' # Trigger on version tags
branches-ignore:
- '**' # Ignore branch pushes, only trigger on tags
- 'v*'

jobs:
noop-on-main:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: No-op on main
run: echo "Release workflow intentionally skipped on main pushes."

test-install:
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,6 +56,7 @@ jobs:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

publish-pypi:
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: release
needs: [test-install]
Expand All @@ -74,6 +83,7 @@ jobs:
twine upload dist/*

create-github-release:
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: release
needs: [test-install]
Expand All @@ -94,60 +104,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

wait-five-minutes:
environment:
name: release
needs: [publish-pypi]
runs-on: ubuntu-latest
steps:
- name: Wait 5 minutes for PyPI propagation
run: |
echo "Waiting 5 minutes for PyPI package propagation..."
sleep 300

publish-docker:
environment:
name: release
needs: [test-install, wait-five-minutes]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PUBLISHING_TOKEN}}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
build-args: |
ELROY_VERSION=${{ steps.version.outputs.version }}
tags: |
ghcr.io/elroy-bot/elroy:latest
ghcr.io/elroy-bot/elroy:${{ steps.version.outputs.version }}


update-stable-and-deploy-branch:
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: release
needs: [publish-docker]
needs: [publish-pypi, create-github-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down