Skip to content

Commit

Permalink
feat: improving developer experience
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Mar 27, 2023
1 parent 029d6cb commit b4657ac
Show file tree
Hide file tree
Showing 37 changed files with 6,194 additions and 510 deletions.
3 changes: 3 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "cz-conventional-changelog"
}
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab
49 changes: 49 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
### Keycloak
KEYCLOAK_ADMIN=keycloak
KEYCLOAK_ADMIN_PASSWORD=keycloak

# https://www.keycloak.org/server/all-config
# Database
KC_DB=postgres
KC_DB_PASSWORD=keycloak
KC_DB_SCHEMA=public
KC_DB_URL_DATABASE=keycloak
KC_DB_URL_HOST=keycloak-database
KC_DB_URL_PORT=5432
KC_DB_USERNAME=keycloak

# Hostname
# KC_HOSTNAME_URL=https://auth.wod.docker
# KC_HOSTNAME_ADMIN_URL=https://auth.wod.docker
KC_HOSTNAME_STRICT=false
KC_INTERNAL_HOSTNAME_URL=http://localhost:8080

# HTTP/TLS
KC_HTTP_ENABLED=true
KC_HTTP_PORT=8080
KC_HTTPS_CERTIFICATE_FILE=/opt/keycloak/conf/cert.pem
KC_HTTPS_CERTIFICATE_KEY_FILE=/opt/keycloak/conf/key.pem
KC_HTTPS_PORT=8443

# Health
KC_HEALTH_ENABLED=true

# Metrics
KC_METRICS_ENABLED=false

# Proxy
KC_PROXY=passthrough

# Custom theme for keycloak
KC_THEME_URL=https://github.com/lukin/keywind

### Initial Keycloak realm settings
OIDC_ADMIN_REALM=operations
OIDC_ADMIN_USER_ID=user
OIDC_ADMIN_APP_SECRET=secret
OIDC_ADMIN_APP_ID=app

OIDC_CLIENT_REALM=client
OIDC_CLIENT_USER_ID=user
OIDC_CLIENT_APP_ID=app
OIDC_CLIENT_APP_SECRET=secret
40 changes: 40 additions & 0 deletions .github/actions/pnpm-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: ⚙️ Monorepo install (pnpm)
description: 'Run pnpm install'

runs:
using: 'composite'

steps:
- name: ⚙️ Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
run_install: false

- name: 🌎 Expose pnpm config(s) through "$GITHUB_OUTPUT"
id: pnpm-config
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: ♻️ Cache rotation keys
id: cache-rotation
shell: bash
run: |
echo "YEAR_WEEK=$(/bin/date -u "+%Y%W")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: 🗄️ Setup pnpm cache
id: pnpm-store-cache
with:
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_WEEK }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_WEEK }}-
- name: 📦 Install dependencies
shell: bash
run: pnpm install --frozen-lockfile --strict-peer-dependencies --prefer-offline
env:
HUSKY: '0'
11 changes: 11 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# this file is for the labeler workflow job
# Documentation https://github.com/marketplace/actions/labeler

'type: documentation':
- assets/**/*
- .github/*
- ./*.md

'type: maintenance':
- .github/**/*
24 changes: 24 additions & 0 deletions .github/workflows/auto-merge-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# https://github.com/peter-evans/enable-pull-request-automerge

on: # yamllint disable-line rule:truthy
pull_request:

permissions:
pull-requests: write
contents: write

name: 🤞 Auto merge release

jobs:
auto-merge:
if: github.actor == 'lotyp' && startsWith(github.head_ref, 'release-please--')
runs-on: ubuntu-latest
steps:
- name: 🤞 Auto-merge pull request
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ github.event.pull_request.number }}
merge-method: merge
# to trigger other workflows, pass PAT token instead of GITHUB_TOKEN
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
on: # yamllint disable-line rule:truthy
merge_group:
push:
branches:
- master
- develop
# Only consider those paths to trigger the action
paths:
- 'packages/**'
- 'package.json'
- 'pnpm*'
- '.github/**'
- 'tsconfig.json'
- 'tsconfig.node.json'

pull_request:
types:
- opened
- synchronize
- reopened
# Only consider those paths to trigger the action
paths:
- 'packages/**'
- 'package.json'
- 'pnpm*'
- '.github/**'
- 'tsconfig.json'
- 'tsconfig.node.json'

name: 🔍 Continuous integration

jobs:
integration:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ['ubuntu-22.04']
node: ['18']

steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v3

- name: ⚙️ Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org/'

- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: ♻️ Restore packages cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.cache
${{ github.workspace }}/**/tsconfig.tsbuildinfo
key: ${{ runner.os }}-packages-cache-${{ hashFiles('**/pnpm*.yaml') }}
restore-keys: |
${{ runner.os }}-packages-cache-${{ hashFiles('**/pnpm*.yaml') }}
# Lint packages that have changed (--include & --since)
- name: 🚨 Linter
run: |
pnpm --filter "...[origin/master]" run lint
28 changes: 28 additions & 0 deletions .github/workflows/codesee-arch-diagram.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
# This workflow was added by CodeSee. Learn more at https://codesee.io/
# This is v2.0 of this workflow file

on: # yamllint disable-line rule:truthy
push:
branches:
- master
- develop
pull_request_target:
types:
- opened
- synchronize
- reopened

name: 🤖 CodeSee

permissions: read-all

jobs:
codesee:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: 💻 Analyze the repo with CodeSee
uses: Codesee-io/codesee-action@v2
with:
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# https://github.com/google-github-actions/release-please-action#release-types-supported

on: # yamllint disable-line rule:truthy
push:
branches:
- master

name: 📦 Create release

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: 🎉 Create release
uses: google-github-actions/release-please-action@v3
id: release
with:
# to trigger other workflows, pass PAT token instead of GITHUB_TOKEN
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
release-type: node
package-name: docker-node
default-branch: master
changelog-types: |
[
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "perf", "section": "Performance Improvements", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "chore", "section": "Miscellaneous", "hidden": false },
{ "type": "style", "section": "Styles", "hidden": true },
{ "type": "revert", "section": "Reverts", "hidden": true },
{ "type": "deps", "section": "Dependencies", "hidden": true },
{ "type": "refactor", "section": "Code Refactoring", "hidden": true },
{ "type": "test", "section": "Tests", "hidden": true },
{ "type": "build", "section": "Build System", "hidden": true },
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
]
22 changes: 22 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md

on: # yamllint disable-line rule:truthy
pull_request:
merge_group:

name: 🏷️ Add labels

jobs:
label:
runs-on: ubuntu-latest
steps:
- name: 🏷️ Apply labels
uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
52 changes: 52 additions & 0 deletions .github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# https://github.com/google-github-actions/release-please-action#release-types-supported

on: # yamllint disable-line rule:truthy
push:
tags:
- 'v*.*.*'

name: 📤 Upload artifacts

jobs:
upload-artifacts:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ['ubuntu-22.04']
node: ['18']

steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v3

- name: ⚙️ Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org/'

- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: ♻️ Restore packages cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.cache
${{ github.workspace }}/**/tsconfig.tsbuildinfo
key: ${{ runner.os }}-packages-cache-${{ hashFiles('**/pnpm*.yaml') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }}
restore-keys: |
${{ runner.os }}-packages-cache-${{ hashFiles('**/pnpm*.yaml') }}-
- name: 🚀 Generate dist files
run: pnpm build:jar

- name: 📤 Upload release assets
uses: alexellis/upload-assets@0.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["./out/keywind.jar"]'
Loading

0 comments on commit b4657ac

Please sign in to comment.