Skip to content
Merged
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
26 changes: 26 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,30 @@ Common types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`.
- **Docker**: Many components rely on Docker for container orchestration during development (e.g., running MongoDB or
Analysis instances).

## Release Strategy

ScriptBee uses a namespaced tagging strategy to manage independent component releases within the monorepo.

### Tag Naming Convention

| Tag Format | Component | Artifact(s) | GitHub Release |
|:-----------------------|:-----------------------------------|:--------------------------------------|:---------------|
| `v<version>` | Unified Application (Backend + UI) | Docker: `dxworks/scriptbee` | **Yes (Main)** |
| `analysis@<version>` | Analysis Microservice | Docker: `dxworks/scriptbee/analysis` | No (Silent) |
| `plugin-api@<version>` | Plugin API | NuGet: `DxWorks.ScriptBee.Plugin.Api` | **Yes** |
| `bundle@<version>` | Default Plugin Bundle | Zip Archive | **Yes** |

### Release Process

1. **Tagging**: Push a tag matching one of the patterns above (e.g., `git tag v1.2.3 && git push origin v1.2.3`).
2. **Automation**: GitHub Actions will automatically:
- Run the relevant test suites.
- Build and publish the artifacts to Docker Hub or NuGet.
- Draft a GitHub Release with auto-generated release notes (for `v*`, `plugin-api@`, and `bundle@`).
3. **Manual Finalization**: The maintainer should review the drafted GitHub Release, refine the notes if necessary, and
publish it.

> All releases are intended to be backward compatible. If a breaking change is required, it must be clearly documented
> in the release notes.

Thank you for your contributions!
68 changes: 68 additions & 0 deletions .github/workflows/release-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release Analysis

on:
push:
tags:
- 'analysis@*'

jobs:
backend-test:
name: Backend Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Restore dependencies
run: dotnet restore ScriptBee.slnx

- name: Build
run: dotnet build ScriptBee.slnx --no-restore

- name: Test
run: dotnet test ScriptBee.slnx --no-build --verbosity normal

analysis-build-push:
name: Analysis Build & Push Docker
needs: backend-test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v6

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

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract version from tag
id: meta
run: |
VERSION="${GITHUB_REF_NAME#*@}"
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Build and push Analysis Docker image
uses: docker/build-push-action@v7
with:
context: .
file: ./analysis.Dockerfile
push: true
tags: |
dxworks/scriptbee/analysis:${{ steps.meta.outputs.version }}
dxworks/scriptbee/analysis:latest
cache-from: type=gha
cache-to: type=gha,mode=max
14 changes: 7 additions & 7 deletions .github/workflows/release-default-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release Default Bundle
on:
push:
tags:
- 'bundle/v*'
- 'bundle@*'

jobs:
build-and-publish:
Expand All @@ -22,9 +22,9 @@ jobs:
- name: Extract version from tag
id: meta
run: |
TAG="${GITHUB_REF#refs/tags/bundle/v}"
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "zip_name=scriptbee-default-bundle-$TAG.zip" >> $GITHUB_OUTPUT
VERSION="${GITHUB_REF_NAME#*@}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "zip_name=scriptbee-default-bundle-$VERSION.zip" >> $GITHUB_OUTPUT

- name: Install zip
run: sudo apt-get install -y zip
Expand All @@ -50,9 +50,9 @@ jobs:
- name: Extract version from tag
id: meta
run: |
TAG="${GITHUB_REF#refs/tags/bundle/v}"
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "zip_name=scriptbee-default-bundle-$TAG.zip" >> $GITHUB_OUTPUT
VERSION="${GITHUB_REF_NAME#*@}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "zip_name=scriptbee-default-bundle-$VERSION.zip" >> $GITHUB_OUTPUT

- name: Download bundle artifact
uses: actions/download-artifact@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-plugin-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release Plugin API
on:
push:
tags:
- 'plugin-api/v*'
- 'plugin-api@*'

jobs:
build-and-publish:
Expand All @@ -22,8 +22,8 @@ jobs:
- name: Extract version from tag
id: meta
run: |
TAG="${GITHUB_REF#refs/tags/plugin-api/v}"
echo "version=$TAG" >> $GITHUB_OUTPUT
VERSION="${GITHUB_REF_NAME#*@}"
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Restore dependencies
run: dotnet restore DxWorks.ScriptBee.Plugin.Api/DxWorks.ScriptBee.Plugin.Api.csproj
Expand Down
101 changes: 16 additions & 85 deletions .github/workflows/release.yml → .github/workflows/release-server.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Release
name: Release Server

on:
push:
tags:
- 'v*'
- 'v[0-9]*'

jobs:
# ------------------------------------------------------------------
Expand Down Expand Up @@ -35,15 +35,15 @@ jobs:
shell: bash
run: |
PLAYWRIGHT_VERSION=$(npm list @vitest/browser-playwright --json | jq -r '.dependencies["@vitest/browser-playwright"].version')
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
echo "version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT

- name: Cache Playwright binaries
uses: actions/cache@v5
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}

- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
Expand All @@ -55,42 +55,6 @@ jobs:
- name: Run tests
run: npm run test:ci

ui-build-push:
name: UI Build & Push Docker
needs: ui-test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v6

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

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract version from tag
id: meta
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and push UI Docker image
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
push: true
tags: |
dxworks/scriptbee:${{ steps.meta.outputs.version }}
dxworks/scriptbee:latest
cache-from: type=gha
cache-to: type=gha,mode=max

# ------------------------------------------------------------------
# BACKEND JOBS
Expand All @@ -117,9 +81,9 @@ jobs:
- name: Test
run: dotnet test ScriptBee.slnx --no-build --verbosity normal

gateway-build-push:
name: Gateway Build & Push Docker
needs: backend-test
server-build-push:
name: Server Build & Push Docker
needs: [ ui-test, backend-test ]
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -140,54 +104,19 @@ jobs:

- name: Extract version from tag
id: meta
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
run: |
VERSION="${GITHUB_REF_NAME#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Build and push Gateway Docker image
- name: Build and push Server Docker image
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
push: true
tags: |
dxworks/scriptbee/gateway:${{ steps.meta.outputs.version }}
dxworks/scriptbee/gateway:latest
cache-from: type=gha
cache-to: type=gha,mode=max

analysis-build-push:
name: Analysis Build & Push Docker
needs: backend-test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v6

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

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract version from tag
id: meta
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and push Analysis Docker image
uses: docker/build-push-action@v7
with:
context: .
file: ./analysis.Dockerfile
push: true
tags: |
dxworks/scriptbee/analysis:${{ steps.meta.outputs.version }}
dxworks/scriptbee/analysis:latest
dxworks/scriptbee:${{ steps.meta.outputs.version }}
dxworks/scriptbee:latest
cache-from: type=gha
cache-to: type=gha,mode=max

Expand All @@ -196,7 +125,7 @@ jobs:
# ------------------------------------------------------------------
create-release:
name: Create GitHub Release
needs: [ ui-build-push, gateway-build-push, analysis-build-push ]
needs: [ server-build-push ]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -209,3 +138,5 @@ jobs:
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
tag_name: ${{ github.ref_name }}
draft: true
23 changes: 14 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Build the client app
# Build the client app
FROM node:24 AS build_client

WORKDIR /src

COPY ./ScriptBeeClient/package*.json ./
COPY ScriptBeeClient/package*.json ./
RUN npm ci

RUN npm install

COPY ./ScriptBeeClient/src ./src
COPY ./ScriptBeeClient/angular.json .
COPY ./ScriptBeeClient/tsconfig*.json ./
COPY ScriptBeeClient/src ./src
COPY ScriptBeeClient/public ./public
COPY ScriptBeeClient/angular.json .
COPY ScriptBeeClient/tsconfig.json .
COPY ScriptBeeClient/tsconfig.app.json .

RUN npm run build-prod

Expand All @@ -28,21 +29,25 @@ COPY ScriptBeeWebApp/src/Workspace ScriptBeeWebApp/src/Workspace
COPY ScriptBeeWebApp/src/Gateway/Application ScriptBeeWebApp/src/Gateway/Application
COPY ScriptBeeWebApp/src/Gateway/Adapters ScriptBeeWebApp/src/Gateway/Adapters

COPY Plugins/ScriptRunner/DxWorks.ScriptBee.Plugin.ScriptRunner.CSharp Plugins/ScriptRunner/DxWorks.ScriptBee.Plugin.ScriptRunner.CSharp
COPY Plugins/ScriptRunner/DxWorks.ScriptBee.Plugin.ScriptRunner.Javascript Plugins/ScriptRunner/DxWorks.ScriptBee.Plugin.ScriptRunner.Javascript
COPY Plugins/ScriptRunner/DxWorks.ScriptBee.Plugin.ScriptRunner.Python Plugins/ScriptRunner/DxWorks.ScriptBee.Plugin.ScriptRunner.Python

RUN dotnet restore ScriptBeeWebApp/src/Gateway/Adapters/Web/Web.csproj

RUN dotnet publish ScriptBeeWebApp/src/Gateway/Adapters/Web/Web.csproj -c Release -o publish --no-restore

# Build the final image
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final

ENV ASPNETCORE_HTTP_PORTS=80
EXPOSE 80
EXPOSE 443

WORKDIR /app

COPY --from=build_webapp /app/publish .

COPY --from=build_client /src/dist/script-bee-ui /app/wwwroot
COPY --from=build_client /src/dist/script-bee-ui/browser ./wwwroot

#ENV LD_LIBRARY_PATH=/app/runtimes/debian.9-x64/native/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
<ImplicitUsings>true</ImplicitUsings>
<PackageId>DxWorks.ScriptBee.Plugin.Api</PackageId>
<Description>This is the API for the ScriptBee plugin.</Description>
<PackageReleaseNotes>ReleaseNotes.md</PackageReleaseNotes>
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/ReleaseNotes/2.0.0.md"))</PackageReleaseNotes>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://github.com/dxworks/scriptbee/tree/master/DxWorks.ScriptBee.Plugin.Api</PackageProjectUrl>
<RepositoryUrl>https://github.com/dxworks/scriptbee</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>1.0.0</Version>
<Version>2.0.0</Version>
<Company>dxworks</Company>
<Authors>dxworks</Authors>
</PropertyGroup>
<ItemGroup>
<None Include="./ReleaseNotes/1.0.0.md" Pack="true" PackagePath="ReleaseNotes.md" />
<None Include="./README.md" Pack="true" PackagePath="" />
<None Include="./LICENSE" Pack="true" PackagePath="" />
</ItemGroup>
Expand Down
Loading
Loading