Skip to content

Commit

Permalink
add files to .github
Browse files Browse the repository at this point in the history
  • Loading branch information
xXSwainXx authored May 5, 2024
1 parent 537335e commit 163771d
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 0 deletions.
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@v4
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'
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 }}
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0

- name: ⚙️ Setup node ${{ matrix.node }}
uses: actions/setup-node@v4
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@v4
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@v4
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@v5
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
51 changes: 51 additions & 0 deletions .github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: ⚙️ Setup node ${{ matrix.node }}
uses: actions/setup-node@v4
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@v4
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') }}
- name: 🚀 Generate dist files
run: pnpm build:jar

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

0 comments on commit 163771d

Please sign in to comment.