From 300270bb71346217bd82a7d5f6f450ef375487c7 Mon Sep 17 00:00:00 2001 From: Ludwig Richter Date: Thu, 22 Apr 2021 23:53:17 +0200 Subject: [PATCH 1/6] feat: Merge setup from https://github.com/fussel178/telestion-rocketsound/tree/feat/merge-with-psc and updated Github Actions workflows --- .editorconfig | 20 ++ .gitattributes | 11 + .github/dependabot.yml | 15 + .github/workflows/publish-core-image.yml | 97 ++++++ .github/workflows/publishImage.yml | 34 -- .github/workflows/test-core-module.yml | 36 +++ .gitignore | 304 +----------------- README.md | 18 +- core/.gitignore | 303 +++++++++++++++++ Dockerfile => core/Dockerfile | 0 build.gradle => core/build.gradle | 0 {conf => core/conf}/config.json | 0 .../gradle}/wrapper/gradle-wrapper.jar | Bin .../gradle}/wrapper/gradle-wrapper.properties | 0 gradlew => core/gradlew | 0 gradlew.bat => core/gradlew.bat | 0 settings.gradle => core/settings.gradle | 0 {src => core/src}/main/java/.gitkeep | 0 gui/README.md | 27 ++ gui/telestion-project | 3 + 20 files changed, 523 insertions(+), 345 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/publish-core-image.yml delete mode 100644 .github/workflows/publishImage.yml create mode 100644 .github/workflows/test-core-module.yml create mode 100644 core/.gitignore rename Dockerfile => core/Dockerfile (100%) rename build.gradle => core/build.gradle (100%) rename {conf => core/conf}/config.json (100%) rename {gradle => core/gradle}/wrapper/gradle-wrapper.jar (100%) rename {gradle => core/gradle}/wrapper/gradle-wrapper.properties (100%) rename gradlew => core/gradlew (100%) rename gradlew.bat => core/gradlew.bat (100%) rename settings.gradle => core/settings.gradle (100%) rename {src => core/src}/main/java/.gitkeep (100%) create mode 100644 gui/README.md create mode 100644 gui/telestion-project diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b765780 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# root editor configuration file +# https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# these configuration apply to all files in this project +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 +indent_style = tab + +[*.md] +trim_trailing_whitespace = false + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dc9e3f5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# only edit text files +* text=auto +# don't use CRLF line endings +*.* text eol=lf + +# binaries +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2059673 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: 'github-actions' # See documentation for possible values + directory: '/' # Location of package manifests + schedule: + interval: 'daily' + open-pull-requests-limit: 10 + commit-message: + prefix: 'chore' + include: 'scope' diff --git a/.github/workflows/publish-core-image.yml b/.github/workflows/publish-core-image.yml new file mode 100644 index 0000000..dde2745 --- /dev/null +++ b/.github/workflows/publish-core-image.yml @@ -0,0 +1,97 @@ +name: Publish Docker Image + +# Events that trigger this workflow +on: [workflow_dispatch] + +jobs: + push-to-registry: + name: Build and push Docker image to GitHub Container Registry + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./core + steps: + - name: Checkout 📥 + uses: actions/checkout@v2.3.4 + - name: Set up JDK 16 💿 + uses: actions/setup-java@v2.0.0 + with: + distribution: 'zulu' + java-version: '16' + java-package: jdk + - name: Set up Docker Buildx ⬆ + uses: docker/setup-buildx-action@v1.1.2 + + - name: Restore gradle cache ♻️ + uses: actions/cache@v2.1.5 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Cache Docker layers ♻️ + uses: actions/cache@v2.1.5 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Build App 🛠️ + run: chmod +x gradlew && ./gradlew assembleDist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Conventional Changelog Action + id: changelog + uses: TriPSs/conventional-changelog-action@v3 + with: + github-token: ${{ secrets.github_token }} + release-count: '0' + - name: Create Release + uses: actions/create-release@v1 + if: ${{ steps.changelog.outputs.skipped == 'false' }} + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + with: + tag_name: ${{ steps.changelog.outputs.tag }} + release_name: ${{ steps.changelog.outputs.tag }} + body: ${{ steps.changelog.outputs.clean_changelog }} + + # You may need to manage write and read access of GitHub Actions + # for this repository in the container settings. + # + # You can also use a personal access token (PAT) with the appropriate scopes. + # + # Please see: + # https://github.com/marketplace/actions/docker-login#github-container-registry + - name: Login to GitHub Container Registry 🛂 + uses: docker/login-action@v1.8.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push docker image 🗜 + uses: docker/build-push-action@v2.4.0 + with: + context: . + pull: true + push: true + platforms: linux/amd64,linux/arm64 + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new + tags: "ghcr.io/${{ github.repository }}:latest" + + # Temporary fix for growing caches + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + # + # Please see: + # https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache + - name: Move cache ♻️ + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/publishImage.yml b/.github/workflows/publishImage.yml deleted file mode 100644 index d7021d1..0000000 --- a/.github/workflows/publishImage.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Publish Docker Image -on: - release: - types: [published] -jobs: - push_to_registry: - name: Push Docker image to GitHub Packages - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - name: Set up JDK 14 - uses: actions/setup-java@v1 - with: - java-version: 14 - - name: Build App - run: chmod +x gradlew && ./gradlew assembleDist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Push to GitHub Packages - uses: docker/build-push-action@v1 - with: - path: ./ - username: ${{ github.ACTOR }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: docker.pkg.github.com - always_pull: true - repository: ORGANIZATION_OR_USER_NAME/REPO_NAME/IMAGE_NAME - cache_froms: ORGANIZATION_OR_USER_NAME/REPO_NAME/IMAGE_NAME:latest - tags: latest - tag_with_ref: true - # tag_with_sha: true - add_git_labels: true - diff --git a/.github/workflows/test-core-module.yml b/.github/workflows/test-core-module.yml new file mode 100644 index 0000000..6d19f9e --- /dev/null +++ b/.github/workflows/test-core-module.yml @@ -0,0 +1,36 @@ +name: Test Core Module + +# Events that trigger this workflow +on: [push, pull_request] + +jobs: + test-core-module: + name: Test Core Module + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./core + steps: + - name: Checkout 📥 + uses: actions/checkout@v2.3.4 + - name: Set up JDK 16 💿 + uses: actions/setup-java@v2.0.0 + with: + distribution: 'zulu' + java-version: '16' + java-package: jdk + + - name: Restore gradle cache ♻️ + uses: actions/cache@v2.1.5 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Test App 🛃 + run: chmod +x gradlew && ./gradlew test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 1eaa523..e78ca78 100644 --- a/.gitignore +++ b/.gitignore @@ -1,303 +1,3 @@ -# Created by .ignore support plugin (hsz.mobi) +# IDE configs .idea - -### Kotlin template -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -### Gradle template -.gradle -**/build/ -!src/**/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Cache of project -.gradletasknamecache - -# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 -# gradle/wrapper/gradle-wrapper.properties - -### Java template -# Compiled class file - -# Log file - -# BlueJ files - -# Mobile Tools for Java (J2ME) - -# Package Files # - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml - -### Eclipse template -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# PyDev specific (Python IDE for Eclipse) -*.pydevproject - -# CDT-specific (C/C++ Development Tooling) -.cproject - -# CDT- autotools -.autotools - -# Java annotation processor (APT) -.factorypath - -# PDT-specific (PHP Development Tools) -.buildpath - -# sbteclipse plugin -.target - -# Tern plugin -.tern-project - -# TeXlipse plugin -.texlipse - -# STS (Spring Tool Suite) -.springBeans - -# Code Recommenders -.recommenders/ - -# Annotation Processing -.apt_generated/ -.apt_generated_test/ - -# Scala IDE specific (Scala & Java development for Eclipse) -.cache-main -.scala_dependencies -.worksheet - -# Uncomment this line if you wish to ignore the project description file. -# Typically, this file would be tracked if it contains build/dependency configurations: -#.project - -### macOS template -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### Linux template -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -### JetBrains template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### MATLAB template -# Windows default autosave extension -*.asv - -# OSX / *nix default autosave extension -*.m~ - -# Compiled MEX binaries (all platforms) -*.mex* - -# Packaged app and toolbox files -*.mlappinstall -*.mltbx - -# Generated helpsearch folders -helpsearch*/ - -# Simulink code generation folders -slprj/ -sccprj/ - -# Matlab code generation folders -codegen/ - -# Simulink autosave extension -*.autosave - -# Simulink cache files -*.slxc - -# Octave session info -octave-workspace - -### Windows template -# Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -### Manual Additions ### -# Eclipse files -*.classpath -*.project - -# Project Files -modules/telestion-mavlink/src/main/messages/org/telestion/mavlink/ +.vscode diff --git a/README.md b/README.md index c9664bb..3a5a4b6 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,18 @@ This is a template for Telestion applications. It helps you to set up the publishing of Telestion applications. -Dependencies to the [main repo](https://github.com/TelestionTeam/telestion) are included, too. +Dependencies to the [main repo](https://github.com/wuespace/telestion) are included, too. ## Necessary Changes -* [ ] `settings.gradle` - set `rootProject.name` -* [ ] `Dockerfile` - replace `TelestionTemplate` in the CMD block by the new project name -* [ ] `build.gradle` - replace `group` by your group name -* [ ] `.github/workflows/publishImage.yml` - update `ORGANIZATION_OR_USER_NAME/REPO_NAME/IMAGE_NAME` -* [ ] `conf/config.json` - adapt to fit your needs -* [ ] `src/main/java` - add your source code -* [ ] Update readme +- [ ] `settings.gradle` - set `rootProject.name` +- [ ] `Dockerfile` - replace `TelestionTemplate` in the CMD block by the new project name +- [ ] `build.gradle` - replace `group` by your group name +- [ ] `conf/config.json` - adapt to fit your needs +- [ ] `src/main/java` - add your source code +- [ ] install the Telestion Client PSC (see `gui/README.md` for further information) +- [ ] update the README ## Example Project -A working example is provided in the [RocketSound repository](https://github.com/TelestionTeam/telestion-rocketsound). +A working example is provided in the [RocketSound repository](https://github.com/wuespace/telestion-rocketsound). diff --git a/core/.gitignore b/core/.gitignore new file mode 100644 index 0000000..1eaa523 --- /dev/null +++ b/core/.gitignore @@ -0,0 +1,303 @@ +# Created by .ignore support plugin (hsz.mobi) +.idea + +### Kotlin template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Gradle template +.gradle +**/build/ +!src/**/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +### Java template +# Compiled class file + +# Log file + +# BlueJ files + +# Mobile Tools for Java (J2ME) + +# Package Files # + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml + +### Eclipse template +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### macOS template +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Linux template +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### MATLAB template +# Windows default autosave extension +*.asv + +# OSX / *nix default autosave extension +*.m~ + +# Compiled MEX binaries (all platforms) +*.mex* + +# Packaged app and toolbox files +*.mlappinstall +*.mltbx + +# Generated helpsearch folders +helpsearch*/ + +# Simulink code generation folders +slprj/ +sccprj/ + +# Matlab code generation folders +codegen/ + +# Simulink autosave extension +*.autosave + +# Simulink cache files +*.slxc + +# Octave session info +octave-workspace + +### Windows template +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +### Manual Additions ### +# Eclipse files +*.classpath +*.project + +# Project Files +modules/telestion-mavlink/src/main/messages/org/telestion/mavlink/ diff --git a/Dockerfile b/core/Dockerfile similarity index 100% rename from Dockerfile rename to core/Dockerfile diff --git a/build.gradle b/core/build.gradle similarity index 100% rename from build.gradle rename to core/build.gradle diff --git a/conf/config.json b/core/conf/config.json similarity index 100% rename from conf/config.json rename to core/conf/config.json diff --git a/gradle/wrapper/gradle-wrapper.jar b/core/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from gradle/wrapper/gradle-wrapper.jar rename to core/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/core/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from gradle/wrapper/gradle-wrapper.properties rename to core/gradle/wrapper/gradle-wrapper.properties diff --git a/gradlew b/core/gradlew similarity index 100% rename from gradlew rename to core/gradlew diff --git a/gradlew.bat b/core/gradlew.bat similarity index 100% rename from gradlew.bat rename to core/gradlew.bat diff --git a/settings.gradle b/core/settings.gradle similarity index 100% rename from settings.gradle rename to core/settings.gradle diff --git a/src/main/java/.gitkeep b/core/src/main/java/.gitkeep similarity index 100% rename from src/main/java/.gitkeep rename to core/src/main/java/.gitkeep diff --git a/gui/README.md b/gui/README.md new file mode 100644 index 0000000..055dc7d --- /dev/null +++ b/gui/README.md @@ -0,0 +1,27 @@ +# Telestion CLient PSC + +It looks like you have not initialized a PSC yet! + +## Initialization + +> **NOTE:** All commands below, unless otherwise specified, +> should get executed in the cloned project's root folder (the git root). + +To set up a PSC for this application, please install an up to date version of: + +- https://nodejs.org/en/ +- npm + +Then install our command line interface globally in your workspace: + +```shell +npm install --global @wuespace/telestion-client-cli +``` + +After the installation, initialize a new PSC: + +```shell +tc-cli init +``` + +Finished! diff --git a/gui/telestion-project b/gui/telestion-project new file mode 100644 index 0000000..8fb44a2 --- /dev/null +++ b/gui/telestion-project @@ -0,0 +1,3 @@ +This file is used to detect the folder structure within our automation tools. + +DO NOT EDIT, MOVE, RENAME, OR REMOVE this file, or our development automation tools might not work as expected From df25352286916c9d880e926073ac971e5566eee4 Mon Sep 17 00:00:00 2001 From: Ludwig Richter Date: Thu, 22 Apr 2021 23:55:34 +0200 Subject: [PATCH 2/6] feat: Add definitions folder --- definitions/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 definitions/.gitkeep diff --git a/definitions/.gitkeep b/definitions/.gitkeep new file mode 100644 index 0000000..e69de29 From 056c69d43ea75c688ee40cec60496c298d020b65 Mon Sep 17 00:00:00 2001 From: Ludwig Richter Date: Fri, 23 Apr 2021 00:04:12 +0200 Subject: [PATCH 3/6] feat: Switch to Java 16 --- core/Dockerfile | 2 +- core/build.gradle | 33 +++---------------- core/gradle/wrapper/gradle-wrapper.properties | 2 +- core/settings.gradle | 5 ++- 4 files changed, 9 insertions(+), 33 deletions(-) diff --git a/core/Dockerfile b/core/Dockerfile index a2bece8..25715e2 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -5,7 +5,7 @@ ENV WORK_DIR /usr/telestion EXPOSE 8080 COPY conf/config.json $WORK_DIR/config.json -COPY build/distributions/RocketSound-*.tar $WORK_DIR/ +COPY build/distributions/TelestionTemplate-*.tar $WORK_DIR/ WORKDIR $WORK_DIR ENTRYPOINT ["sh", "-c"] diff --git a/core/build.gradle b/core/build.gradle index fba6d77..894dc97 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'maven' + id 'maven-publish' id 'application' } @@ -11,7 +11,6 @@ sourceCompatibility = gradle.sourceCompatibility targetCompatibility = gradle.targetCompatibility application { - applicationDefaultJvmArgs = ['--enable-preview'] mainClassName = 'org.telestion.application.Telestion' } @@ -32,10 +31,10 @@ dependencies { implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.12.1' implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.1' implementation "io.vertx:vertx-core:4.0.2" - compile 'io.github.telestionteam:telestion-api:0.0.11' - compile 'io.github.telestionteam:telestion-app:0.0.11' - compile 'io.github.telestionteam:telestion-services:0.0.11' - compile 'io.github.telestionteam:telestion-examples:0.0.11' + implementation 'io.github.telestionteam:telestion-api:0.0.11' + implementation 'io.github.telestionteam:telestion-app:0.0.11' + implementation 'io.github.telestionteam:telestion-services:0.0.11' + implementation 'io.github.telestionteam:telestion-examples:0.0.11' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' } @@ -44,31 +43,9 @@ test { useJUnitPlatform() } -tasks.withType(JavaExec) { - systemProperties System.properties - systemProperties "hazelcast.logging.type":"slf4j" - - //enable modules for hazelcast - jvmArgs += ["--add-modules", "java.se", - "--add-exports", "java.base/jdk.internal.ref=ALL-UNNAMED", - "--add-opens", "java.base/java.lang=ALL-UNNAMED", - "--add-opens", "java.base/java.nio=ALL-UNNAMED", - "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", - "--add-opens", "java.management/sun.management=ALL-UNNAMED", - "--add-opens", "jdk.management/com.sun.management.internal=ALL-UNNAMED"] -} - -//enable preview features -tasks.withType(JavaCompile) { - options.compilerArgs += "--enable-preview" -} tasks.withType(Test) { - jvmArgs += "--enable-preview" ignoreFailures = true reports { junitXml.enabled = true } } -tasks.withType(JavaExec) { - jvmArgs += '--enable-preview' -} diff --git a/core/gradle/wrapper/gradle-wrapper.properties b/core/gradle/wrapper/gradle-wrapper.properties index be52383..f371643 100644 --- a/core/gradle/wrapper/gradle-wrapper.properties +++ b/core/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/core/settings.gradle b/core/settings.gradle index 6400b1b..2cec91b 100644 --- a/core/settings.gradle +++ b/core/settings.gradle @@ -1,5 +1,4 @@ rootProject.name = 'TelestionTemplate' -gradle.ext.sourceCompatibility = '14' -gradle.ext.targetCompatibility = '14' - +gradle.ext.sourceCompatibility = '16' +gradle.ext.targetCompatibility = '16' From e30dff30c5e560a094baef346879cf56910285e0 Mon Sep 17 00:00:00 2001 From: Ludwig Richter Date: Fri, 23 Apr 2021 12:38:28 +0200 Subject: [PATCH 4/6] feat: Separate conventional release and build steps --- .github/workflows/publish-core-image.yml | 31 ++++++++-------- .github/workflows/release.yml | 45 ++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish-core-image.yml b/.github/workflows/publish-core-image.yml index dde2745..1eedbc8 100644 --- a/.github/workflows/publish-core-image.yml +++ b/.github/workflows/publish-core-image.yml @@ -1,12 +1,16 @@ name: Publish Docker Image # Events that trigger this workflow -on: [workflow_dispatch] +on: + workflow_run: + workflows: ["Release"] + types: [completed] jobs: push-to-registry: name: Build and push Docker image to GitHub Container Registry runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} defaults: run: working-directory: ./core @@ -22,6 +26,15 @@ jobs: - name: Set up Docker Buildx ⬆ uses: docker/setup-buildx-action@v1.1.2 + - name: Restore cache release upload URL ♻️ + uses: actions/cache@v2.1.5 + with: + path: ~/.build-env + key: 'github-release-action' + + - name: Import environment + run: cat ~/.build-env >> $GITHUB_ENV + - name: Restore gradle cache ♻️ uses: actions/cache@v2.1.5 with: @@ -44,22 +57,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Conventional Changelog Action - id: changelog - uses: TriPSs/conventional-changelog-action@v3 - with: - github-token: ${{ secrets.github_token }} - release-count: '0' - - name: Create Release - uses: actions/create-release@v1 - if: ${{ steps.changelog.outputs.skipped == 'false' }} - env: - GITHUB_TOKEN: ${{ secrets.github_token }} - with: - tag_name: ${{ steps.changelog.outputs.tag }} - release_name: ${{ steps.changelog.outputs.tag }} - body: ${{ steps.changelog.outputs.clean_changelog }} - # You may need to manage write and read access of GitHub Actions # for this repository in the container settings. # diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dc0c4a6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release + +# Events that trigger this workflow +on: [workflow_dispatch] + +jobs: + conventional-release: + name: Conventional Commit Release + runs-on: ubuntu-latest + steps: + - name: Checkout 📥 + uses: actions/checkout@v2.3.4 + + - name: Cache release upload URL ♻️ + uses: actions/cache@v2.1.5 + with: + path: ~/.build-env + key: 'github-release-action' + + - name: Conventional Changelog Action + id: changelog + uses: TriPSs/conventional-changelog-action@v3 + with: + github-token: ${{ secrets.github_token }} + release-count: '0' + - name: Create Release + uses: actions/create-release@v1 + if: ${{ steps.changelog.outputs.skipped == 'false' }} + id: create_release + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + with: + tag_name: ${{ steps.changelog.outputs.tag }} + release_name: ${{ steps.changelog.outputs.tag }} + body: ${{ steps.changelog.outputs.clean_changelog }} + + - name: Store upload url 🗜 + run: | + echo "upload_url=${UPLOAD_URL}" >> ~/.build-env + echo "tag=${RELEASE_TAG}" >> ~/.build-env + echo "skipped=${RELEASE_SKIPPED}" >> ~/.build-env + env: + UPLOAD_URL: ${{ steps.create_release.outputs.upload_url }} + RELEASE_TAG: ${{ steps.changelog.outputs.tag }} + RELEASE_SKIPPED: ${{ steps.changelog.outputs.skipped }} From 9b8a5675504845a81ff9138bf44a986b2b9b931f Mon Sep 17 00:00:00 2001 From: Ludwig Richter Date: Mon, 26 Apr 2021 13:30:53 +0200 Subject: [PATCH 5/6] feat: Add intended releace cycle to Contributing Guidelines --- CONTRIBUTING.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9ccb96b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,39 @@ +# Contributing Guidelines + +## Intended Release Cycle + +When you want to release a new application, go to the _Actions_ Tab in the GitHub UI and choose the `Release` Action. +Then click `Run workflow`. + +![image](https://user-images.githubusercontent.com/52416718/115860012-71cb7500-a420-11eb-9af1-d5faf0768f67.png) + +This triggers the Release Action which automatically creates a Conventional Commit Release on GitHub. +Afterwards the subsequent build actions are triggered via: +```yml +on: + workflow_run: + workflows: ["Release"] + types: [completed] +``` + +Additionally, if you want to upload release assets in these build workflows, you can use the cached build environment: +```yml + - name: Restore cache release upload URL ♻️ + uses: actions/cache@v2.1.5 + with: + path: ~/.build-env + key: 'github-release-action' + + - name: Import environment + run: cat ~/.build-env >> $GITHUB_ENV + + - name: Upload release asset + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.upload_url }} + asset_path: ./dist/artifact1.txt + asset_name: artifact1.txt + asset_content_type: text/plain +``` From b557f42f81d50a1f13cee5bd0a1aab333ee1bc77 Mon Sep 17 00:00:00 2001 From: Ludwig Richter Date: Mon, 26 Apr 2021 13:41:52 +0200 Subject: [PATCH 6/6] feat: Add review suggestions Co-authored-by: pklaschka Co-authored-by: jvpichowski --- .github/workflows/publish-core-image.yml | 2 +- .github/workflows/test-core-module.yml | 2 +- README.md | 4 ++-- {core => application}/.gitignore | 0 application/Dockerfile | 12 ++++++++++++ {core => application}/build.gradle | 5 +++-- {core => application}/conf/config.json | 0 .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 {core => application}/gradlew | 0 {core => application}/gradlew.bat | 0 {core => application}/settings.gradle | 2 +- {core => application}/src/main/java/.gitkeep | 0 {gui => client}/README.md | 2 +- core/Dockerfile | 12 ------------ gui/telestion-project => telestion-project | 0 16 files changed, 21 insertions(+), 20 deletions(-) rename {core => application}/.gitignore (100%) create mode 100644 application/Dockerfile rename {core => application}/build.gradle (88%) rename {core => application}/conf/config.json (100%) rename {core => application}/gradle/wrapper/gradle-wrapper.jar (100%) rename {core => application}/gradle/wrapper/gradle-wrapper.properties (100%) rename {core => application}/gradlew (100%) rename {core => application}/gradlew.bat (100%) rename {core => application}/settings.gradle (61%) rename {core => application}/src/main/java/.gitkeep (100%) rename {gui => client}/README.md (95%) delete mode 100644 core/Dockerfile rename gui/telestion-project => telestion-project (100%) diff --git a/.github/workflows/publish-core-image.yml b/.github/workflows/publish-core-image.yml index 1eedbc8..72e069b 100644 --- a/.github/workflows/publish-core-image.yml +++ b/.github/workflows/publish-core-image.yml @@ -13,7 +13,7 @@ jobs: if: ${{ github.event.workflow_run.conclusion == 'success' }} defaults: run: - working-directory: ./core + working-directory: ./application steps: - name: Checkout 📥 uses: actions/checkout@v2.3.4 diff --git a/.github/workflows/test-core-module.yml b/.github/workflows/test-core-module.yml index 6d19f9e..880385d 100644 --- a/.github/workflows/test-core-module.yml +++ b/.github/workflows/test-core-module.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ./core + working-directory: ./application steps: - name: Checkout 📥 uses: actions/checkout@v2.3.4 diff --git a/README.md b/README.md index 79382be..ed40239 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This is a template for Telestion applications. It helps you to set up the publishing of Telestion applications. -Dependencies to the [main repo](https://github.com/wuespace/telestion) are included, too. +Dependencies to the [main repo](https://github.com/wuespace/telestion-core) are included, too. ## Necessary Changes @@ -13,7 +13,7 @@ Dependencies to the [main repo](https://github.com/wuespace/telestion) are inclu i.e., beginning with the company url in reverse) - [ ] `conf/config.json` - adapt to fit your needs - [ ] `src/main/java` - add your source code -- [ ] install the Telestion Client PSC (see `gui/README.md` for further information) +- [ ] install the Telestion Client PSC (see [`client/README.md`](client/README.md) for further information) - [ ] update the README ## Example Project diff --git a/core/.gitignore b/application/.gitignore similarity index 100% rename from core/.gitignore rename to application/.gitignore diff --git a/application/Dockerfile b/application/Dockerfile new file mode 100644 index 0000000..df689d1 --- /dev/null +++ b/application/Dockerfile @@ -0,0 +1,12 @@ +FROM openjdk:14-alpine + +ENV WORK_DIR /usr/telestion + +EXPOSE 8080 + +COPY conf/config.json $WORK_DIR/config.json +COPY build/distributions/Telestion Project Template-*.tar $WORK_DIR/ + +WORKDIR $WORK_DIR +ENTRYPOINT ["sh", "-c"] +CMD ["tar -xf *.tar && cd Telestion\ Project\ Template-* && mkdir conf && cp ../config.json conf/config.json && ./bin/TelestionTemplate"] diff --git a/core/build.gradle b/application/build.gradle similarity index 88% rename from core/build.gradle rename to application/build.gradle index 894dc97..455e5c4 100644 --- a/core/build.gradle +++ b/application/build.gradle @@ -4,14 +4,14 @@ plugins { id 'application' } -group 'org.telestion.telestiontemplate' +group 'de.wuespace.telestion.project.template' version '1.0-SNAPSHOT' sourceCompatibility = gradle.sourceCompatibility targetCompatibility = gradle.targetCompatibility application { - mainClassName = 'org.telestion.application.Telestion' + mainClassName = 'de.wuespace.telestion.Main' } @@ -19,6 +19,7 @@ repositories { mavenCentral() maven { name = "GitHubPackages" + // TODO: Move to https://maven.pkg.github.com/wuespace/telestion-core/ url = uri("https://maven.pkg.github.com/TelestionTeam/telestion/") credentials { username = System.getenv("GITHUB_ACTOR") diff --git a/core/conf/config.json b/application/conf/config.json similarity index 100% rename from core/conf/config.json rename to application/conf/config.json diff --git a/core/gradle/wrapper/gradle-wrapper.jar b/application/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from core/gradle/wrapper/gradle-wrapper.jar rename to application/gradle/wrapper/gradle-wrapper.jar diff --git a/core/gradle/wrapper/gradle-wrapper.properties b/application/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from core/gradle/wrapper/gradle-wrapper.properties rename to application/gradle/wrapper/gradle-wrapper.properties diff --git a/core/gradlew b/application/gradlew similarity index 100% rename from core/gradlew rename to application/gradlew diff --git a/core/gradlew.bat b/application/gradlew.bat similarity index 100% rename from core/gradlew.bat rename to application/gradlew.bat diff --git a/core/settings.gradle b/application/settings.gradle similarity index 61% rename from core/settings.gradle rename to application/settings.gradle index 2cec91b..30bf16f 100644 --- a/core/settings.gradle +++ b/application/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = 'TelestionTemplate' +rootProject.name = 'Telestion Project Template' gradle.ext.sourceCompatibility = '16' gradle.ext.targetCompatibility = '16' diff --git a/core/src/main/java/.gitkeep b/application/src/main/java/.gitkeep similarity index 100% rename from core/src/main/java/.gitkeep rename to application/src/main/java/.gitkeep diff --git a/gui/README.md b/client/README.md similarity index 95% rename from gui/README.md rename to client/README.md index 055dc7d..cba5d17 100644 --- a/gui/README.md +++ b/client/README.md @@ -1,4 +1,4 @@ -# Telestion CLient PSC +# Telestion Client PSC It looks like you have not initialized a PSC yet! diff --git a/core/Dockerfile b/core/Dockerfile deleted file mode 100644 index 25715e2..0000000 --- a/core/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM openjdk:14-alpine - -ENV WORK_DIR /usr/telestion - -EXPOSE 8080 - -COPY conf/config.json $WORK_DIR/config.json -COPY build/distributions/TelestionTemplate-*.tar $WORK_DIR/ - -WORKDIR $WORK_DIR -ENTRYPOINT ["sh", "-c"] -CMD ["tar -xf *.tar && cd TelestionTemplate-* && mkdir conf && cp ../config.json conf/config.json && ./bin/TelestionTemplate"] diff --git a/gui/telestion-project b/telestion-project similarity index 100% rename from gui/telestion-project rename to telestion-project