Skip to content

Commit 6ecf365

Browse files
authored
⬆️ Update GitHub Actions workflows and dependencies (#14)
* ⬆️ Update GitHub Actions workflows and dependencies * 🔧 Add TypeScript ESLint rules * 🔧 Update .dockerignore, .eslintrc.yaml, and package.json * ✏️ Update Docker image in GitHub workflow
1 parent 289f4d1 commit 6ecf365

13 files changed

+117
-23
lines changed

.dockerignore

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1+
# Folders
2+
.git
3+
.github
4+
.vscode
5+
dist
6+
docs
7+
node_modules
8+
9+
# Files
110
.dockerignore
211
.editorconfig
312
.eslintignore
413
.eslintrc.yaml
5-
.git
6-
.github
714
.gitignore
815
.prettierignore
916
.prettierrc.yaml
10-
.vscode
1117
*.md
1218
*.test.ts
1319
*.tsbuildinfo
1420
*.txt
15-
dist
1621
Dockerfile
17-
docs
18-
node_modules
1922
tsconfig.eslint.json
2023
typedoc.json

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.pnpm-store/
12
dist/
23
docs/
34
node_modules/

.eslintrc.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,28 @@ parserOptions:
1515
plugins:
1616
- "@typescript-eslint"
1717
rules:
18+
"@typescript-eslint/class-methods-use-this": error
19+
"@typescript-eslint/consistent-type-exports": error
1820
"@typescript-eslint/consistent-type-imports":
1921
- error
2022
- fixStyle: separate-type-imports
23+
"@typescript-eslint/default-param-last": error
24+
"@typescript-eslint/explicit-member-accessibility":
25+
- error
26+
- accessibility: no-public
27+
"@typescript-eslint/method-signature-style": error
28+
"@typescript-eslint/no-import-type-side-effects": error
29+
"@typescript-eslint/no-unnecessary-qualifier": error
30+
"@typescript-eslint/no-useless-empty-export": error
31+
"@typescript-eslint/prefer-nullish-coalescing":
32+
- error
33+
- ignorePrimitives: true
34+
"@typescript-eslint/prefer-readonly": error
35+
"@typescript-eslint/prefer-regexp-exec": error
36+
"@typescript-eslint/promise-function-async":
37+
- error
38+
- checkArrowFunctions: false
39+
"@typescript-eslint/require-array-sort-compare": error
40+
"@typescript-eslint/return-await": error
41+
"@typescript-eslint/sort-type-constituents": error
2142
"@typescript-eslint/switch-exhaustiveness-check": error

.github/workflows/docker.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches: main
6+
tags: v*
7+
pull_request:
8+
branches: main
9+
10+
jobs:
11+
docker:
12+
runs-on: ubuntu-latest
13+
14+
if: github.actor != 'nektos/act'
15+
16+
permissions:
17+
packages: write
18+
contents: read
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: docker/login-action@v3
24+
if: github.actor != 'dependabot[bot]'
25+
with:
26+
username: ${{ vars.DOCKER_USERNAME }}
27+
password: ${{ secrets.DOCKER_PASSWORD }}
28+
29+
- uses: docker/login-action@v3
30+
if: github.actor != 'dependabot[bot]'
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- id: meta
37+
uses: docker/metadata-action@v5
38+
with:
39+
images: |
40+
natoboram/gigachad.ts
41+
ghcr.io/${{ github.repository }}
42+
tags: |
43+
type=ref,event=tag
44+
type=semver,pattern={{major}}
45+
type=semver,pattern={{major}}.{{minor}}
46+
type=semver,pattern={{major}}.{{minor}}.{{patch}}
47+
type=semver,pattern={{version}}
48+
49+
- uses: docker/build-push-action@v5
50+
with:
51+
context: .
52+
push: ${{ github.ref_type == 'tag' }}
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/github-pages.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ jobs:
88
build_pages:
99
runs-on: ubuntu-latest
1010

11+
if: github.actor != 'nektos/act'
12+
1113
steps:
12-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1315
- uses: pnpm/action-setup@v2
1416
with:
1517
version: latest
16-
- uses: actions/setup-node@v3
18+
- uses: actions/setup-node@v4
1719
with:
1820
node-version: 21
1921
cache: pnpm
20-
- run: pnpm install --frozen-lockfile
22+
- run: pnpm install
2123
- run: pnpm run docs
22-
- uses: actions/upload-pages-artifact@v1
24+
- uses: actions/upload-pages-artifact@v3
2325
with:
2426
path: docs
2527

@@ -37,5 +39,5 @@ jobs:
3739
runs-on: ubuntu-latest
3840

3941
steps:
40-
- uses: actions/deploy-pages@v1
41-
id: deployment
42+
- id: deployment
43+
uses: actions/deploy-pages@v4

.github/workflows/node.js.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
- uses: pnpm/action-setup@v2
1616
with:
1717
version: latest
18-
- uses: actions/setup-node@v3
18+
- uses: actions/setup-node@v4
1919
with:
2020
node-version: 21
2121
cache: pnpm

.github/workflows/pnpm-publish.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,29 @@ jobs:
1313
contents: read
1414
packages: write
1515

16+
if: github.actor != 'nektos/act'
17+
1618
steps:
17-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1820
- uses: pnpm/action-setup@v2
1921
with:
2022
version: latest
21-
- uses: actions/setup-node@v3
23+
- uses: actions/setup-node@v4
2224
with:
2325
cache: pnpm
2426
node-version: 21
25-
- run: pnpm install --frozen-lockfile
27+
- run: pnpm install
2628
- run: pnpm build
2729

28-
- uses: actions/setup-node@v3
30+
- uses: actions/setup-node@v4
2931
with:
3032
registry-url: https://npm.pkg.github.com
3133
scope: "@natoboram"
3234
- run: pnpm publish --access public --no-git-checks
3335
env:
3436
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3537

36-
- uses: actions/setup-node@v3
38+
- uses: actions/setup-node@v4
3739
with:
3840
registry-url: https://registry.npmjs.org
3941
scope: "@natoboram"

.github/workflows/pnpm-version-patch.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ jobs:
99
permissions:
1010
contents: write
1111

12+
if: github.actor != 'nektos/act' && github.ref_name == 'main'
13+
1214
steps:
13-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1416
with:
1517
ssh-key: ${{ secrets.SIGNING_KEY_PRIVATE }}
1618
- uses: pnpm/action-setup@v2
1719
with:
1820
version: latest
19-
- uses: actions/setup-node@v3
21+
- uses: actions/setup-node@v4
2022
with:
2123
cache: pnpm
2224
node-version: 21
@@ -25,14 +27,17 @@ jobs:
2527
git config user.name 'github-actions[bot]'
2628
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
2729
30+
git config commit.gpgsign true
2831
git config gpg.format ssh
2932
git config user.signingkey 'key::${{ vars.SIGNING_KEY_PUBLIC }}'
3033
3134
eval `ssh-agent -s`
3235
ssh-add - <<< '${{ secrets.SIGNING_KEY_PRIVATE }}'
3336
34-
VERSION=$(pnpm version patch)
37+
VERSION=$(pnpm version patch --no-git-tag-version)
3538
39+
git commit --all --message "🔖 $VERSION"
40+
git tag $VERSION
3641
git push
3742
git push --tags
3843

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.pnpm-store/
12
bun.lockb
23
dist/
34
docs/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.pnpm-store/
12
dist/
23
docs/
34
node_modules/

0 commit comments

Comments
 (0)