Skip to content

Commit

Permalink
Merge pull request #26 from modelix/automated-releases
Browse files Browse the repository at this point in the history
Automated releases
  • Loading branch information
slisson authored May 23, 2024
2 parents 5969bf2 + e7a5cd3 commit 9e9cf44
Show file tree
Hide file tree
Showing 58 changed files with 12,297 additions and 173 deletions.
31 changes: 30 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
version: 2
registries:
maven-central:
type: maven-repository
url: https://repo.maven.apache.org/maven2/
maven-itemis:
type: maven-repository
url: https://artifacts.itemis.cloud/repository/maven-mps/
updates:
- package-ecosystem: "gradle"
open-pull-requests-limit: 20
registries:
- maven-central
- maven-itemis
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
commit-message:
prefix: "build(deps)"
prefix-development: "build(deps)"
- package-ecosystem: "github-actions"
open-pull-requests-limit: 20
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "build(deps)"
prefix-development: "build(deps)"
- package-ecosystem: "npm"
open-pull-requests-limit: 20
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "build(deps)"
prefix-development: "build(deps)"
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build -PciBuild=true
run: ./gradlew build -PciBuild=true
45 changes: 45 additions & 0 deletions .github/workflows/dry-run-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Dry-Run Release
on:
pull_request:

jobs:
lint-commits:
name: Lint PR commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6

test-release:
name: Dry-run semantic-release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout branch
# Pretend to semantic-release that the PR result is eligible for
# building releases because --dry-run still filters for configured
# branches.
run: git checkout -b main
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache Node packages
uses: actions/cache@v4
with:
path: node_modules
key: release-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Dry-run release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# We need to convince semantic-release to not pick up some
# configuration from the CI environment by removing the variable that
# is used for CI detection.
run: unset GITHUB_ACTIONS && npx semantic-release --dry-run --ci false
12 changes: 12 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Code linting

on:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC

jobs:
release:
name: Run semantic release
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache Node packages
uses: actions/cache@v4
with:
path: node_modules
key: release-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: npx semantic-release
2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
default_install_hook_types:
- pre-commit
- commit-msg
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.4.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@commitlint/config-angular"]
args: ["--config", "./commitlint.config.js"]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.12.0
hooks:
- id: pretty-format-kotlin
args:
- --ktlint-version=0.50.0
- --autofix
21 changes: 21 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"branches": [
"master"
],
"tagFormat": "${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "angular"
}
],
"@semantic-release/github"
]
}
16 changes: 8 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ repositories {

kotlin {
/* Targets configuration omitted.
* To find out how to configure the targets, please follow the link:
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */
* To find out how to configure the targets, please follow the link:
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */

jvm {
jvmToolchain(11)
Expand Down Expand Up @@ -68,7 +68,6 @@ kotlin {
}
}


allOpen {
annotation("org.openjdk.jmh.annotations.State")
}
Expand All @@ -85,7 +84,7 @@ benchmark {
iterationTime = 1
iterationTimeUnit = "s"
outputTimeUnit = "s"
//mode = "avgt"
// mode = "avgt"
reportFormat = "text"
include(".*")
}
Expand Down Expand Up @@ -121,10 +120,11 @@ publishing {
if (project.hasProperty("artifacts.itemis.cloud.user")) {
maven {
name = "itemisNexus3"
url = if (version.toString().contains("SNAPSHOT"))
uri("https://artifacts.itemis.cloud/repository/maven-mps-snapshots/")
else
uri("https://artifacts.itemis.cloud/repository/maven-mps-releases/")
url = if (version.toString().contains("SNAPSHOT")) {
uri("https://artifacts.itemis.cloud/repository/maven-mps-snapshots/")
} else {
uri("https://artifacts.itemis.cloud/repository/maven-mps-releases/")
}
credentials {
username = project.findProperty("artifacts.itemis.cloud.user").toString()
password = project.findProperty("artifacts.itemis.cloud.pw").toString()
Expand Down
18 changes: 18 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"scope-enum": [
2,
"always",
[
"deps",
],
],
"subject-case": [0, 'never'],
"body-max-line-length": [0, 'always'],
"footer-max-line-length": [0, 'always']
},
ignores: [
(message) => message.includes('skip-lint')
],
};
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
kotlin.code.style=official
kotlin.code.style=official
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[versions]

kotlin = "1.9.23"
kotlin = "1.9.24"
kotlinCoroutines="1.8.1"
kotlinBenchmark = "0.4.10"

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 9e9cf44

Please sign in to comment.