Skip to content

Commit

Permalink
Merge pull request #2 from wuespace/feat/new-template-structure
Browse files Browse the repository at this point in the history
feat: New template structure
  • Loading branch information
fussel178 authored Apr 26, 2021
2 parents 75d4cfa + b557f42 commit 9bc1583
Show file tree
Hide file tree
Showing 26 changed files with 675 additions and 437 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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'
94 changes: 94 additions & 0 deletions .github/workflows/publish-core-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Publish Docker Image

# Events that trigger this workflow
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: ./application
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 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:
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 }}

# 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
34 changes: 0 additions & 34 deletions .github/workflows/publishImage.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
36 changes: 36 additions & 0 deletions .github/workflows/test-core-module.yml
Original file line number Diff line number Diff line change
@@ -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: ./application
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 }}
Loading

0 comments on commit 9bc1583

Please sign in to comment.