-
-
Notifications
You must be signed in to change notification settings - Fork 32
ci: set up semantic-release #815
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
Open
line-o
wants to merge
2
commits into
eXist-db:develop
Choose a base branch
from
Jinntec:ci
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 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,3 @@ | ||
| module.exports = { | ||
| extends: ['@commitlint/config-conventional'], | ||
| }; |
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,24 @@ | ||
| name: Commit lint | ||
| run-name: Linting commit messages | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - synchronize | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint commit messages | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 'lts/*' | ||
| cache: 'npm' | ||
| - run: npm ci --omit=optional | ||
| - run: npx commitlint --from=${{ github.event.pull_request.base.sha }} |
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,35 @@ | ||
| name: Semantic Release | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: [test] | ||
| branches: [main] | ||
| types: | ||
| - completed | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| release: | ||
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
| name: Release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| issues: write | ||
| pull-requests: write | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 'lts/*' | ||
| cache: 'npm' | ||
| - run: npm ci --omit=optional | ||
| - run: npm run build | ||
| - run: npx semantic-release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,88 @@ | ||
| # This workflow builds a xar archive, deploys it into exist and execute its test suites. | ||
| # It also includes code for using semantic-release to upload packages as part of GitHub releases | ||
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
|
||
| name: Test | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # eXide 4.0 requires eXist 7.0+ (lang/cursor modules from existdb-openapi), | ||
| # so we test only against the 'latest' (develop) Docker tag. | ||
| exist-version: [latest] | ||
| # Node 22 is EOL; track current Node LTS (24). | ||
| node-version: ['24'] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| # Install dependencies and build EXPath Package | ||
| - name: Install node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run unit tests | ||
| run: npm test | ||
|
|
||
| - name: Validate OpenAPI schema | ||
| run: npx --yes @redocly/cli lint modules/api.json | ||
|
|
||
| - name: Build frontend Using node.js ${{ matrix.node-version }} and build EXPath Package | ||
| run: npm run build | ||
|
|
||
| - name: Download Roaster dependency | ||
| run: gh release download v1.12.0 --repo eeditiones/roaster --pattern "roaster-1.12.0.xar" --output build/roaster-1.12.0.xar | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
|
|
||
| - name: Download existdb-openapi dependency | ||
| run: gh release download v0.9.5 --repo eXist-db/existdb-openapi --pattern "existdb-openapi-*.xar" --dir build/ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 0.9.7 or simply latest same above for roaster |
||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
|
|
||
| - name: Start eXist-db Docker Container | ||
| run: docker run --rm --name exist --volume $(pwd)/build:/exist/autodeploy:ro --publish 8080:8080 --detach existdb/existdb:${{ matrix.exist-version }} | ||
|
|
||
| - name: Wait for eXist-db Startup and Package Deployment | ||
| run: | | ||
| for i in $(seq 1 24); do | ||
| HTTP_CODE=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/exist/apps/eXide/index.html || true) | ||
| echo "Attempt $i: HTTP $HTTP_CODE" | ||
| if [ "$HTTP_CODE" = "200" ]; then | ||
| echo "eXide is ready" | ||
| exit 0 | ||
| fi | ||
| sleep 5 | ||
| done | ||
| echo "Timed out waiting for eXide" | ||
| exit 1 | ||
|
|
||
| - name: Run Cypress Integration Tests | ||
| run: npx cypress run --spec 'cypress/e2e/*.cy.js' | ||
|
|
||
| - name: Upload Cypress Screenshots (on failure) | ||
| uses: actions/upload-artifact@v7 | ||
| if: failure() | ||
| with: | ||
| name: cypress-screenshots-${{ matrix.exist-version }}-${{ matrix.node-version }} | ||
| path: cypress/screenshots | ||
|
|
||
| # Test run video was always captured, so this action uses "always()" condition | ||
| - name: Upload Cypress Videos | ||
| uses: actions/upload-artifact@v7 | ||
| if: always() | ||
| with: | ||
| name: cypress-videos-${{ matrix.exist-version }}-${{ matrix.node-version }} | ||
| path: cypress/videos | ||
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
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,4 @@ | ||
| #!/bin/sh | ||
| . "$(dirname "$0")/_/husky.sh" | ||
|
|
||
| npx --no-install commitlint --edit "$1" |
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,30 @@ | ||
| { | ||
| "branches": [ | ||
| "main" | ||
| ], | ||
| "plugins": [ | ||
| [ | ||
| "@semantic-release/commit-analyzer", | ||
| { | ||
| "preset": "conventionalcommits" | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/release-notes-generator", | ||
| { | ||
| "preset": "conventionalcommits" | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/github", | ||
| { | ||
| "assets": [ | ||
| { | ||
| "path": "build/*.xar", | ||
| "name": "eXide-${nextRelease.version}.xar" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.12.1 ?