Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
NatoBoram authored Sep 17, 2024
0 parents commit 255db38
Show file tree
Hide file tree
Showing 36 changed files with 3,407 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Folders
.git
.github
.vscode
dist
docs
node_modules

# Files
.dockerignore
.editorconfig
.eslintignore
.eslintrc.yaml
.gitignore
.prettierignore
.prettierrc.yaml
*.md
*.test.ts
*.tsbuildinfo
*.txt
Dockerfile
tsconfig.eslint.json
typedoc.json
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.yaml]
indent_style = space
Empty file added .env
Empty file.
1 change: 1 addition & 0 deletions .github/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
first-line-heading: false
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @NatoBoram
5 changes: 5 additions & 0 deletions .github/FUNDING.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
github:
- NatoBoram
patreon: NatoBoram
custom:
- https://paypal.me/NatoBoram/5
1 change: 1 addition & 0 deletions .github/authorized_keys
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
41898282+github-actions[bot]@users.noreply.github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE0nNJJzdXWCLFEqZd4BMgzbTfabG3Z2kamWwXOpRqBI 41898282+github-actions[bot]@users.noreply.github.com
40 changes: 40 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
timezone: America/Toronto
commit-message:
prefix: "⬆️ "
groups:
patch:
update-types:
- patch
minor-development:
update-types:
- minor
dependency-type: development
minor-production:
update-types:
- minor
dependency-type: production
eslint:
patterns:
- "*eslint*"
prettier:
patterns:
- "*prettier*"
typescript:
patterns:
- "*typescript*"
- tsx
- typedoc

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
timezone: America/Toronto
commit-message:
prefix: "⬆️ "
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Replace this by a short description under 60 characters -->

### 📝 Description

<!-- Why this pull request? -->

<!-- Why is this the best solution? -->

<!-- What you did -->

### 📓 References

<!-- A list of links to discussions, documentation, issues, pull requests -->
54 changes: 54 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Docker CI

on:
push:
branches: main
tags: v*
pull_request:
branches: main

jobs:
docker:
runs-on: ubuntu-latest

if: github.actor != 'nektos/act'

permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
if: github.actor != 'dependabot[bot]'
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- uses: docker/login-action@v3
if: github.actor != 'dependabot[bot]'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: meta
uses: docker/metadata-action@v5
with:
images: |
natoboram/gigachad.ts
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{version}}
- uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
43 changes: 43 additions & 0 deletions .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: GitHub Pages

on:
push:
branches: main

jobs:
build_pages:
runs-on: ubuntu-latest

if: github.actor != 'nektos/act'

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: latest
cache: pnpm
- run: pnpm install
- run: pnpm run docs
- uses: actions/upload-pages-artifact@v3
with:
path: docs

deploy_pages:
needs: build_pages

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- id: deployment
uses: actions/deploy-pages@v4
25 changes: 25 additions & 0 deletions .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Node.js CI

on:
push:
branches: main
pull_request:
branches: main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: latest
cache: pnpm
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
- run: pnpm run build --noEmit
- run: pnpm run lint
- run: pnpm run test run
57 changes: 57 additions & 0 deletions .github/workflows/pnpm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Node.js Publish

on:
push:
tags:
- v*

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: write # Upload the release files
id-token: write # Add `--provenance`
packages: write # Publish the package

if: github.actor != 'nektos/act'

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: latest
- run: pnpm install
- run: pnpm build

- uses: actions/setup-node@v4
with:
registry-url: https://npm.pkg.github.com
scope: "@natoboram"
- run: pnpm publish --access public --no-git-checks --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org
scope: "@natoboram"
- run: pnpm publish --access public --no-git-checks --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

- run: pnpm pack --pack-gzip-level 9
- name: Sign
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.DEPLOY_KEY_PRIVATE }}'
echo '${{ vars.DEPLOY_KEY_PUBLIC }}' > '${{ runner.temp }}/DEPLOY_KEY_PUBLIC.pub'
ssh-keygen -Y sign -f '${{ runner.temp }}/DEPLOY_KEY_PUBLIC.pub' -n file natoboram-gigachad.ts-*.tgz
ssh-keygen -Y verify -f ./.github/authorized_keys -I '41898282+github-actions[bot]@users.noreply.github.com' -n file -s natoboram-gigachad.ts-*.tgz.sig < natoboram-gigachad.ts-*.tgz
- run: gh release upload ${{ github.ref_name }} natoboram-gigachad.ts-*.tgz natoboram-gigachad.ts-*.tgz.sig
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/pnpm-version-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Node.js Patch

on: workflow_dispatch

jobs:
patch:
runs-on: ubuntu-latest

permissions:
contents: write

if: github.actor != 'nektos/act' && github.ref_name == 'main'

steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY_PRIVATE }}
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: latest
- name: Configure Git, patch, release and push
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git config commit.gpgsign true
git config gpg.format ssh
git config push.gpgSign 'if-asked'
git config tag.gpgSign true
git config user.signingkey 'key::${{ vars.DEPLOY_KEY_PUBLIC }}'
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.DEPLOY_KEY_PRIVATE }}'
VERSION=$(pnpm version patch --no-git-tag-version)
git commit --all --message "🔖 $VERSION"
git tag --annotate --message "🔖 $VERSION" --sign $VERSION
git push
git push --tags
gh release create $VERSION --generate-notes --title $VERSION --verify-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 255db38

Please sign in to comment.