Skip to content

Commit c41afdb

Browse files
Update config
Also: * Start removing JS and Dart support. * Migrate to new ToolBase and PluginBase APIs.
1 parent 8670af5 commit c41afdb

239 files changed

Lines changed: 19276 additions & 1797 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codecov.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,23 @@
77

88
coverage:
99
ignore:
10-
- generated/*
11-
- examples/*
12-
- test/*
10+
- "**/generated/**/*"
11+
- "**/examples/**/*"
12+
- "**/test/**/*"
1313
status:
14+
# https://docs.codecov.com/docs/github-checks#yaml-configuration-for-github-checks-and-codecov
1415
patch: false
16+
# https://docs.codecov.com/docs/commit-status
17+
project:
18+
default:
19+
target: auto
20+
threshold: 0.05%
21+
base: auto
22+
paths:
23+
- "src"
24+
if_ci_failed: error
25+
informational: false
26+
only_pulls: true
1527

1628
comment:
1729
layout: "header, diff, changes, uncovered"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build under Ubuntu
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build under Ubuntu
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
submodules: 'true'
14+
15+
- uses: actions/setup-java@v4
16+
with:
17+
java-version: 17
18+
distribution: zulu
19+
cache: gradle
20+
21+
- name: Build project and run tests
22+
shell: bash
23+
run: ./gradlew build --stacktrace
24+
25+
# See: https://github.com/marketplace/actions/junit-report-action
26+
- name: Publish Test Report
27+
uses: mikepenz/action-junit-report@v4.0.3
28+
if: always() # always run even if the previous step fails
29+
with:
30+
report_paths: '**/build/test-results/**/TEST-*.xml'
31+
require_tests: true # will fail workflow if test reports not found
32+
33+
- name: Upload code coverage report
34+
uses: codecov/codecov-action@v4
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}
37+
fail_ci_if_error: false
38+
verbose: true
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build under Windows
2+
3+
on: pull_request
4+
5+
jobs:
6+
build:
7+
name: Build under Windows
8+
runs-on: windows-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
submodules: 'true'
14+
15+
- uses: actions/setup-java@v4
16+
with:
17+
java-version: 17
18+
distribution: zulu
19+
cache: gradle
20+
21+
# See: https://github.com/al-cheb/configure-pagefile-action
22+
- name: Configure Pagefile
23+
uses: al-cheb/configure-pagefile-action@v1.3
24+
25+
- name: Build project and run tests
26+
shell: cmd
27+
# For the reason on `--no-daemon` see https://github.com/actions/cache/issues/454
28+
run: gradlew.bat build --stacktrace --no-daemon
29+
30+
# See: https://github.com/marketplace/actions/junit-report-action
31+
- name: Publish Test Report
32+
uses: mikepenz/action-junit-report@v4.0.3
33+
if: always() # always run even if the previous step fails
34+
with:
35+
report_paths: '**/build/test-results/**/TEST-*.xml'
36+
require_tests: true # will fail workflow if test reports not found
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Ensures that the license report files were modified in this PR.
2+
3+
name: Ensure license reports updated
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
build:
12+
name: Ensure license reports updated
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
# Configure the checkout of all branches, so that it is possible to run the comparison.
19+
fetch-depth: 0
20+
# Check out the `config` submodule to fetch the required script file.
21+
submodules: true
22+
23+
- name: Check that both `pom.xml` and license report files are modified
24+
shell: bash
25+
run: chmod +x ./config/scripts/ensure-reports-updated.sh && ./config/scripts/ensure-reports-updated.sh
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Validate Gradle Wrapper
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
validation:
12+
name: Gradle Wrapper Validation
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout latest code
16+
uses: actions/checkout@v4
17+
18+
- name: Validate Gradle Wrapper
19+
uses: gradle/actions/wrapper-validation@v4
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Ensures that the current lib version is not yet published but executing the Gradle
2+
# `checkVersionIncrement` task.
3+
4+
name: Check version increment
5+
6+
on:
7+
push:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
build:
13+
name: Check version increment
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: 'true'
20+
21+
- uses: actions/setup-java@v4
22+
with:
23+
java-version: 17
24+
distribution: zulu
25+
cache: gradle
26+
27+
- name: Check version is not yet published
28+
shell: bash
29+
run: ./gradlew checkVersionIncrement --stacktrace

.github/workflows/publish.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
submodules: 'true'
14+
15+
- uses: actions/setup-java@v4
16+
with:
17+
java-version: 17
18+
distribution: zulu
19+
cache: gradle
20+
21+
- name: Decrypt CloudRepo credentials
22+
run: ./config/scripts/decrypt.sh "$CLOUDREPO_CREDENTIALS_KEY" ./.github/keys/cloudrepo.properties.gpg ./cloudrepo.properties
23+
env:
24+
CLOUDREPO_CREDENTIALS_KEY: ${{ secrets.CLOUDREPO_CREDENTIALS_KEY }}
25+
26+
- name: Decrypt Git SSH credentials
27+
run: ./config/scripts/decrypt.sh "$GIT_CREDENTIALS_KEY" ./.github/keys/deploy_key_rsa.gpg ./deploy_key_rsa
28+
env:
29+
GIT_CREDENTIALS_KEY: ${{ secrets.GIT_CREDENTIALS_KEY }}
30+
31+
# Make sure the SSH key is not "too visible". SSH agent will not accept it otherwise.
32+
- name: Set file system permissions
33+
run: chmod 400 ./deploy_key_rsa && chmod +x ./config/scripts/register-ssh-key.sh
34+
35+
- name: Decrypt GCS credentials
36+
run: ./config/scripts/decrypt.sh "$GCS_CREDENTIALS_KEY" ./.github/keys/gcs-auth-key.json.gpg ./gcs-auth-key.json
37+
env:
38+
GCS_CREDENTIALS_KEY: ${{ secrets.GCS_CREDENTIALS_KEY }}
39+
40+
- name: Decrypt GCAR credentials
41+
run: ./config/scripts/decrypt.sh "$MAVEN_PUBLISHER_KEY" ./.github/keys/maven-publisher.json.gpg ./maven-publisher.json
42+
env:
43+
MAVEN_PUBLISHER_KEY: ${{ secrets.MAVEN_PUBLISHER_KEY }}
44+
45+
- name: Decrypt Git SSH credentials
46+
run: ./config/scripts/decrypt.sh "$GRADLE_PORTAL_CREDENTIALS_KEY" ./.github/keys/gradle-plugin-portal.secret.properties.gpg ./gradle-plugin-portal.secret.properties
47+
env:
48+
GRADLE_PORTAL_CREDENTIALS_KEY: ${{ secrets.GRADLE_PORTAL_CREDENTIALS_KEY }}
49+
50+
- name: Append Gradle properties
51+
run: cat ./gradle-plugin-portal.secret.properties >> ./gradle.properties
52+
53+
- name: Publish artifacts to Maven
54+
# Since we're in the `master` branch already, this means that tests of a PR passed.
55+
# So, no need to run the tests again when publishing.
56+
run: ./gradlew publish -x test --stacktrace
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
FORMAL_GIT_HUB_PAGES_AUTHOR: developers@spine.io
60+
# https://docs.github.com/en/actions/reference/environment-variables
61+
REPO_SLUG: $GITHUB_REPOSITORY # e.g. SpineEventEngine/core-java
62+
GOOGLE_APPLICATION_CREDENTIALS: ./maven-publisher.json
63+
NPM_TOKEN: ${{ secrets.NPM_SECRET }}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#
2+
# Periodically removes obsolete artifacts from GitHub Packages.
3+
#
4+
# Only non-release artifacts—those containing "SNAPSHOT" in their version name—are eligible
5+
# for removal. The latest non-release artifacts will be retained, with the exact number determined
6+
# by the `VERSION_COUNT_TO_KEEP` environment variable.
7+
#
8+
# Please note the following details:
9+
#
10+
# 1. An artifact cannot be deleted if it is public and has been downloaded more than 5,000 times.
11+
# In this scenario, contact GitHub support for further assistance.
12+
#
13+
# 2. This workflow only applies to artifacts published from this repository.
14+
#
15+
# 3. A maximum of 100 artifacts can be removed per run from each package;
16+
# if there are more than 100 obsolete artifacts, either manually restart the workflow
17+
# or wait for the next scheduled removal.
18+
#
19+
# 4. When artifacts with version `x.x.x-SNAPSHOT` are published, GitHub automatically appends
20+
# the current timestamp, resulting in versions like `x.x.x-SNAPSHOT.20241024.173759`.
21+
# All such artifacts are grouped into one package and treated as a single package
22+
# in GitHub Packages with the version `x.x.x-SNAPSHOT`. Consequently, it is not possible
23+
# to remove obsolete versions within a package; only the entire package can be deleted.
24+
#
25+
26+
name: Remove obsolete Maven artifacts from GitHub Packages
27+
28+
on:
29+
schedule:
30+
- cron: '0 0 * * *' # Run every day at midnight.
31+
32+
env:
33+
VERSION_COUNT_TO_KEEP: 5 # Number of most recent SNAPSHOT versions to retain.
34+
35+
jobs:
36+
retrieve-package-names:
37+
name: Retrieve the package names published from this repository
38+
runs-on: ubuntu-latest
39+
outputs:
40+
package-names: ${{ steps.request-package-names.outputs.package-names }}
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
submodules: 'true'
45+
46+
- name: Retrieve the names of packages
47+
id: request-package-names
48+
shell: bash
49+
run: |
50+
repoName=$(echo ${{ github.repository }} | cut -d '/' -f2)
51+
chmod +x ./config/scripts/request-package-names.sh
52+
./config/scripts/request-package-names.sh ${{ github.token }} \
53+
$repoName ${{ github.repository_owner }} ./package-names.json
54+
echo "package-names=$(<./package-names.json)" >> $GITHUB_OUTPUT
55+
56+
delete-obsolete-artifacts:
57+
name: Remove obsolete artifacts published from this repository to GitHub Packages
58+
needs: retrieve-package-names
59+
runs-on: ubuntu-latest
60+
strategy:
61+
matrix:
62+
package-name: ${{ fromJson(needs.retrieve-package-names.outputs.package-names) }}
63+
steps:
64+
- name: Remove obsolete artifacts from '${{ matrix.package-name }}' package
65+
uses: actions/delete-package-versions@v5
66+
with:
67+
owner: ${{ github.repository_owner }}
68+
package-name: ${{ matrix.package-name }}
69+
package-type: 'maven'
70+
token: ${{ github.token }}
71+
min-versions-to-keep: ${{ env.VERSION_COUNT_TO_KEEP }}
72+
# Ignores artifacts that do not contain the word "SNAPSHOT".
73+
ignore-versions: '^(?!.+SNAPSHOT).*$'

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
#
3232
# Therefore, instructions below are superset of instructions required for all the projects.
3333

34+
# `jenv` file with the local version of Java.
35+
.java-version
36+
37+
# Kotlin temp directories.
38+
**/.kotlin/**
39+
3440
# IntelliJ IDEA modules and interim config files.
3541
*.iml
3642
.idea/*.xml
@@ -50,6 +56,7 @@
5056

5157
# Gradle build files
5258
**/build/**
59+
!**/src/**/build/
5360

5461
# Build files produced by the IDE
5562
**/out/**

.idea/codeStyles/Project.xml

Lines changed: 14 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)