Skip to content
Draft
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions .github/workflows/.build-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ on:
cache_mode:
type: string
default: min
raw_tag:
type: string
version_tag:
type: string
latest_tag:
type: boolean
default: false

jobs:
build-and-push-image:
Expand All @@ -44,12 +51,9 @@ jobs:
with:
images: ${{ inputs.registry }}/${{ inputs.image_name }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
# set latest tag for main branch
type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
type=semver,pattern={{version}},enable=${{ inputs.version_tag != '' }},value=${{ inputs.version_tag }}
type=raw,value=${{ inputs.raw_tag }}
type=raw,value=latest,enable=${{ inputs.latest_tag }}

- name: "Build${{ inputs.push && ' and push' || '' }}"
uses: docker/build-push-action@v7
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/build-worker-bundles.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Docker images

on:
pull_request:
push:
branches: [main]
merge_group:

permissions:
Expand All @@ -16,13 +14,11 @@ jobs:
with:
image_name: ${{ github.repository }}
dockerfile: ./packaging/docker/Dockerfile
push: ${{ github.ref_name == 'main' }}
cache_mode: max

worker:
uses: ./.github/workflows/.build-push-docker-image.yml
with:
image_name: ${{ github.repository }}-worker
dockerfile: ./packaging/docker/worker.Dockerfile
push: ${{ github.ref_name == 'main' }}
cache_mode: off # cache is really slow for this file
77 changes: 77 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Release

on:
push:
branches: [create-gh-releases]

jobs:
build-worker-bundles:
strategy:
matrix:
target: [darwin-aarch64, darwin-x86_64, linux-aarch64, linux-x86_64, win-x86_64]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.1.0

- name: Build Worker Bundle
run: ./worker/packaging/build_worker_bundle.py ${{matrix.target}}

- name: Compress Worker Bundle
run: xz worker/packaging/build/worker-${{matrix.target}}.tar
- uses: actions/upload-artifact@v7
with:
path: worker/packaging/build/worker-${{matrix.target}}.tar.xz
archive: false

push-docker-backend:
uses: ./.github/workflows/.build-push-docker-image.yml
with:
image_name: ${{ github.repository }}
raw_tag: dev+${{ github.sha }}
latest_tag: true # we only have dev releases at the moment
dockerfile: ./packaging/docker/Dockerfile
push: true
cache_mode: max

push-docker-worker:
uses: ./.github/workflows/.build-push-docker-image.yml
with:
image_name: ${{ github.repository }}-worker
raw_tag: dev+${{ github.sha }}
latest_tag: true # we only have dev releases at the moment
dockerfile: ./packaging/docker/worker.Dockerfile
push: true
cache_mode: off # cache is really slow for this file

upload-release:
needs:
- build-worker-bundles
- push-docker-backend
- push-docker-worker
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
with:
skip-decompress: true
merge-multiple: true

- name: Create manifest.json
run: |
set -euo pipefail
manifest="{}"
for f in worker*.tar.xz; do
sum=$(sha256sum "$f" | awk '{print $1}')
manifest=$(echo "$manifest" | jq ".files.[\"$f\"].sha256 = \"$sum\"")
done
echo "$manifest" > manifest.json

- uses: softprops/action-gh-release@v3
with:
tag_name: dev+${{ github.sha }}
target_commitish: ${{ github.sha }}
prerelease: true
files: |
worker-*.tar.xz
manifest.json
Loading