Skip to content

Commit

Permalink
Merge pull request #1 from gbh-tech/feat-MSP-11-initialize-terminator
Browse files Browse the repository at this point in the history
feat: (MSP-11) Initiate git-terminator scripts
  • Loading branch information
angelmadames authored Oct 9, 2024
2 parents 9a986c8 + 58e6242 commit 48e4b32
Show file tree
Hide file tree
Showing 16 changed files with 695 additions and 10 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 📝 Lint

on:
pull_request:
branches:
- main

concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: 💻 Checkout current code ref
uses: actions/checkout@v4

- name: 🟢 Configure Bun on runner
uses: oven-sh/setup-bun@v1

- name: 📦 Install package dependencies using lockfile
run: bun install --frozen-lockfile

- name: 🔨 Run build
run: bun run build

- name: 🌷 Run format, lint & check with Biome
run: |
bun run format
bun run lint
bun run check
commitlint:
runs-on: ubuntu-latest
steps:
- name: 💻 Checkout current code ref
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🟢 Configure Bun on runner
uses: oven-sh/setup-bun@v1

- name: 🚧 Install dev dependencies
run: npm install --only=dev

# Check all commits pushed to this PR
- name: 👁️‍🗨️ Validate PR commits with commitlint
run: >-
npx commitlint
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }}
--to ${{ github.event.pull_request.head.sha }}
--verbose
- name: 🔎 Validate PR title with commitlint
run: echo "${{ github.event.pull_request.title }}" | npx commitlint
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 🚀 Release

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: 💻 Checkout current pull-request revision code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.DEVOPS_USER_TOKEN }}

- name: 🟢 Configure Bun on runner
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: 🔵 Install Task
uses: arduino/setup-task@v2

- name: 💼 Configure Git user
run: |
git config user.name "gbh-devops-bot"
git config user.email "[email protected]"
- name: 📦 Install package dependencies using lockfile
run: bun install --frozen-lockfile

- name: 🔨 Compile binary for supported platforms
run: |
task build
task compress
- name: 🚀 Release a new version
run: bun release-it --ci
env:
GITHUB_TOKEN: ${{ secrets.DEVOPS_USER_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/s3-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 🚀 Deploy to S3

on:
push:
branches:
- main

env:
BUCKET: 's3://gbh-utils'
NAME: 'git-cleaner'

jobs:
deploy-s3:
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux-x64, linux-arm64, windows-x64, darwin-arm64, darwin-x64]
steps:
- name: 💻 Checkout current code ref
uses: actions/checkout@v4

- name: 🟢 Configure Bun on runner
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: 🔵 Install Task
uses: arduino/setup-task@v2

- name: 🟡 Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-1'

- name: 📦 Install package dependencies using lockfile
run: bun install --frozen-lockfile

- name: 🔨 Compile binary for supported platforms
run: |
task build
task compress
- name: 🚀 Upload binaries to S3
run: aws s3 cp ./dist ${BUCKET}/${NAME} --recursive --acl public-read
64 changes: 56 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,178 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
*.log
npm-debug.log*
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
*.pid
*.seed
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files
.cache/

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp
.cache

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test
.vscode

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store

terminator
3 changes: 3 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

npx --no -- commitlint --edit ${1}
9 changes: 9 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

BRANCH=$(git rev-parse --abbrev-ref HEAD)
REGEX="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)-[A-Z]{2,4}-[0-9]{1,5}-[A-Za-z0-9-]+$"

if ! [[ $BRANCH =~ $REGEX ]]; then
echo "Your commit was rejected due to branching name"
exit 1
fi
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bun 1.1.21
Loading

0 comments on commit 48e4b32

Please sign in to comment.