Skip to content
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

fix(ci): ci enhancements #496

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
45 changes: 24 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,22 @@

name: exist-db CI

on: [push, pull_request]
on: [push]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: npm install
# Run the commitlint action, considering its own dependencies and yours as well 🚀
# `github.workspace` is the path to your repository.
- uses: wagoid/commitlint-github-action@v6
env:
NODE_PATH: ${{ github.workspace }}/node_modules
build:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -73,42 +86,32 @@ jobs:
do sleep 2s; \
done

# Test
# Test
- name: Run smoke test
run: bats --tap tests/bats/*.bats

# TODO: add further tests

# Lint commit messages
- name: lint commit message
uses: wagoid/commitlint-github-action@v6

# Commit repo.xml file
- name: Commit and Push
if: ${{ matrix.java-version == 17 && github.event_name == 'push' && github.ref != 'refs/heads/master' }}
uses: actions-x/commit@v6
with:
message: "fix(repo.xml): update [skip ci]"

release:
name: Release
runs-on: ubuntu-latest
needs: build
needs:
- commitlint
- build
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: npm
cache: npm
node-version: lts/*
- name: Install dependencies
run: npm ci --no-optional
run: npm ci --no-optional
- name: Perform Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLIC_REPO: ${{ secrets.PUBLIC_REPO }}
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
run: npx semantic-release
# TODO(DP):
# - add secrets to github
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ resources/fonts
resources/scripts/app.all.js
resources/scripts/app.min.js
/templates
expath-pkg.xml

# test reports
tests/reports/errorShots/*
Expand Down
52 changes: 19 additions & 33 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,27 @@
"master"
],
"plugins": [
"@semantic-release/commit-analyzer",
{
["@semantic-release/commit-analyzer", {
"preset": "conventionalcommits"
},
"@semantic-release/release-notes-generator",
{
}],
["@semantic-release/release-notes-generator", {
"preset": "conventionalcommits"
},
[
"@semantic-release/exec",
{
}],
["@semantic-release/exec", {
"prepareCmd": "ant -Denv.HSG_ENV=production -Dapp.version=${nextRelease.version}"
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"package-lock.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "build/hsg-shell.xar",
"name": "hsg-shell.xar",
"label": "Expath package (hsg-shell.xar)"
}
]
}
]
}],
["@semantic-release/git", {
"assets": ["expath-pkg.xml", "repo.xml"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
["@semantic-release/github", {
"assets": [
{
"path": "build/hsg-shell.xar",
"name": "hsg-shell.xar",
"label": "Expath package (hsg-shell.xar)"
}
]
}]
]
}
2 changes: 1 addition & 1 deletion commitlint.config.cjs → commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [1, 'always', 200]
Expand Down
Loading
Loading