-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add release automation #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
| ] | ||
| ] | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.