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
126 changes: 126 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Release

on:
push:
branches: [ main, release ]
workflow_dispatch:

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
test:
name: Test (Node ${{ matrix.node }} - Camunda ${{ matrix.camunda }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: true
matrix:
node: [22, 24]
camunda: ['8.8', '8.9']

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

- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run unit tests
run: npm run test:unit

- name: Start Camunda ${{ matrix.camunda }} with Docker Compose
run: |
cd assets/c8/${{ matrix.camunda }}
DATABASE=elasticsearch docker compose --profile elasticsearch up -d
env:
DATABASE: elasticsearch

- name: Wait for Camunda to be ready
run: |
echo "Waiting for Camunda at localhost:8080..."
# First wait for topology endpoint
for i in {1..60}; do
if curl -s -f -u demo:demo http://localhost:8080/v2/topology > /dev/null; then
echo "Topology endpoint is ready!"
break
fi
echo "Attempt $i: Topology not ready yet, waiting..."
sleep 5
done

# Then wait an additional 30 seconds for broker to fully initialize
echo "Waiting additional time for broker to initialize..."
sleep 30

# Verify we can actually deploy
echo "Testing deployment capability..."
for i in {1..30}; do
if curl -s -u demo:demo http://localhost:8080/v2/topology | grep -q '"health":"healthy"'; then
echo "Broker is healthy, ready for deployments!"
exit 0
fi
echo "Attempt $i: Broker not fully ready, waiting..."
sleep 2
done

echo "Camunda may not be fully ready, but continuing with tests..."

- name: Run integration tests
run: npm run test:integration

- name: Stop Camunda
if: always()
run: |
cd assets/c8/${{ matrix.camunda }}
DATABASE=elasticsearch docker compose --profile elasticsearch down -v
env:
DATABASE: elasticsearch

- name: Show Camunda logs on failure
if: failure()
run: |
cd assets/c8/${{ matrix.camunda }}
DATABASE=elasticsearch docker compose --profile elasticsearch logs
env:
DATABASE: elasticsearch

release:
name: Release
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
issues: write
pull-requests: write
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js 22.18.0
uses: actions/setup-node@v4
with:
node-version: 22.18.0
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: 'true'
run: npx semantic-release
27 changes: 27 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"branches": [
"release",
{
"name": "main",
"prerelease": "alpha",
"channel": "alpha"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": true
}
],
[
"@semantic-release/github",
{
"successComment": "This has been released in ${nextRelease.version}.",
"failComment": false
}
]
]
}