From 0784cdae3178e493c606bd9727a165316e1b98ef Mon Sep 17 00:00:00 2001 From: elroy-bot Date: Fri, 3 Apr 2026 11:08:39 -0700 Subject: [PATCH] update release --- .github/workflows/release.yml | 69 ++++++++--------------------------- 1 file changed, 15 insertions(+), 54 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55432a9b..dcc30587 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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] @@ -74,6 +83,7 @@ jobs: twine upload dist/* create-github-release: + if: startsWith(github.ref, 'refs/tags/v') environment: name: release needs: [test-install] @@ -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