Skip to content

Commit d9a8a8a

Browse files
committed
ci: github actions workflows added
1 parent a365c3a commit d9a8a8a

File tree

27 files changed

+11615
-28
lines changed

27 files changed

+11615
-28
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
# Unix-style newlines with a newline ending every file
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
8+
[*.kt]
9+
ktlint_standard_filename = disabled
10+
ktlint_standard_trailing-comma-on-call-site = disabled

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: 2
2+
registries:
3+
maven-central:
4+
type: maven-repository
5+
url: https://repo.maven.apache.org/maven2/
6+
maven-itemis:
7+
type: maven-repository
8+
url: https://artifacts.itemis.cloud/repository/maven-mps/
9+
updates:
10+
- package-ecosystem: "gradle"
11+
open-pull-requests-limit: 20
12+
registries:
13+
- maven-central
14+
- maven-itemis
15+
directory: "/"
16+
schedule:
17+
interval: "weekly"
18+
commit-message:
19+
prefix: "build(deps)"
20+
prefix-development: "build(deps)"
21+
- package-ecosystem: "github-actions"
22+
open-pull-requests-limit: 20
23+
directory: "/"
24+
schedule:
25+
interval: "weekly"
26+
commit-message:
27+
prefix: "build(deps)"
28+
prefix-development: "build(deps)"

.github/workflows/build.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request: {}
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up JDK
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: 'temurin'
19+
java-version: '21'
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version-file: '.nvmrc'
23+
- name: Build
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: ./gradlew build -PciBuild=true -Pgpr.token=${{ secrets.GITHUB_TOKEN }}
27+
- name: Archive test report
28+
uses: actions/upload-artifact@v4
29+
if: always()
30+
with:
31+
name: test-report
32+
path: |
33+
*/build/test-results
34+
*/build/reports
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Dry-Run Release
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
lint-commits:
7+
name: Lint PR commits
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- uses: wagoid/commitlint-github-action@v6
14+
15+
test-release:
16+
name: Dry-run semantic-release
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Checkout branch
24+
# Pretend to semantic-release that the PR result is eligible for
25+
# building releases because --dry-run still filters for configured
26+
# branches.
27+
run: git checkout -b main
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version-file: '.nvmrc'
31+
- name: Cache Node packages
32+
uses: actions/cache@v4
33+
with:
34+
path: node_modules
35+
key: release-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
36+
- name: Install dependencies
37+
run: npm ci
38+
- name: Dry-run release
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
41+
# We need to convince semantic-release to not pick up some
42+
# configuration from the CI environment by removing the variable that
43+
# is used for CI detection.
44+
run: unset GITHUB_ACTIONS && npx semantic-release --dry-run --ci false

.github/workflows/linting.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Code linting
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pre-commit:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
12+
- uses: pre-commit/[email protected]

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
newRelease:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version-file: '.nvmrc'
20+
- name: Set up JDK
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: 'temurin'
24+
java-version: '21'
25+
- name: Set up Gradle
26+
uses: gradle/gradle-build-action@v3
27+
- name: Use tag as version
28+
run: echo "${GITHUB_REF#refs/*/}" > version.txt
29+
- name: Build and Publish Artifacts
30+
run: >-
31+
./gradlew
32+
--build-cache
33+
build
34+
publish
35+
-PciBuild=true
36+
-Partifacts.itemis.cloud.user=${{secrets.ARTIFACTS_ITEMIS_CLOUD_USER}}
37+
-Partifacts.itemis.cloud.pw=${{secrets.ARTIFACTS_ITEMIS_CLOUD_PW}}
38+
-Pgpr.user=${{ github.actor }}
39+
-Pgpr.key=${{ secrets.GITHUB_TOKEN }}
40+
-Pgpr.token=${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 2 * * *' # run at 2 AM UTC
6+
7+
jobs:
8+
release:
9+
name: Run semantic release
10+
runs-on: ubuntu-latest
11+
if: ${{ github.ref == 'refs/heads/main' }}
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
token: ${{ secrets.RELEASE_TOKEN }}
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version-file: '.nvmrc'
21+
- name: Cache Node packages
22+
uses: actions/cache@v4
23+
with:
24+
path: node_modules
25+
key: release-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
31+
run: npx semantic-release

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.13.0

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
default_install_hook_types:
3+
- pre-commit
4+
- commit-msg
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.4.0
8+
hooks:
9+
# - id: end-of-file-fixer # disabled, because it modifies MPS XML files
10+
- id: check-toml
11+
- id: check-yaml
12+
- id: check-added-large-files
13+
- id: check-merge-conflict
14+
- id: check-symlinks
15+
- id: fix-byte-order-marker
16+
- id: mixed-line-ending
17+
# - id: trailing-whitespace # disabled, because it modifies multiline string literals to invalid values
18+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
19+
rev: v9.4.0
20+
hooks:
21+
- id: commitlint
22+
stages: [commit-msg]
23+
additional_dependencies: ["@commitlint/config-angular"]
24+
args: ["--config", "./commitlint.config.js"]
25+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
26+
rev: v2.12.0
27+
hooks:
28+
- id: pretty-format-kotlin
29+
args:
30+
- --ktlint-version=0.50.0
31+
- --autofix

.releaserc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"tagFormat": "${version}",
6+
"plugins": [
7+
[
8+
"@semantic-release/commit-analyzer",
9+
{
10+
"preset": "conventionalcommits"
11+
}
12+
],
13+
[
14+
"@semantic-release/release-notes-generator",
15+
{
16+
"preset": "angular"
17+
}
18+
],
19+
"@semantic-release/github"
20+
]
21+
}

0 commit comments

Comments
 (0)