Skip to content

Commit d299285

Browse files
authored
Merge branch 'master' into sbg-utility
2 parents 34fa3b3 + 4a6d2c0 commit d299285

File tree

442 files changed

+38964
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

442 files changed

+38964
-76
lines changed

.gitattributes

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
* text=auto
2+
*.txt text eol=lf
3+
4+
# Language Diffs
5+
6+
*.cs diff=csharp
7+
*.css diff=css
8+
*.cpp diff=cpp
9+
*.go diff=golang
10+
*.h diff=cpp
11+
*.html diff=html eol=lf
12+
*.java diff=java
13+
*.md diff=markdown
14+
*.py diff=python
15+
*.rs diff=rust
16+
*.ruby diff=ruby
17+
*.sh diff=bash eol=lf
18+
Gemfile diff=ruby
19+
*.json text eol=lf
20+
*.vcproj text eol=crlf
21+
*.ts text eol=lf
22+
*.js text eol=lf
23+
24+
# Windows
25+
26+
*.bat eol=crlf
27+
*.cmd eol=crlf
28+
29+
# Documents
30+
31+
*.doc binary diff=exif
32+
*.docx binary diff=docx
33+
*.dot binary diff=exif
34+
*.dotx binary diff=exif
35+
*.xls binary diff=exif
36+
*.xlsx binary diff=exif
37+
*.xlt binary diff=exif
38+
*.xltm binary diff=exif
39+
*.odb binary diff=exif
40+
*.odf binary diff=exif
41+
*.odg binary diff=exif
42+
*.odi binary diff=exif
43+
*.odp binary diff=exif
44+
*.ods binary diff=exif
45+
*.odt binary diff=odt
46+
*.otc binary diff=exif
47+
*.otg binary diff=exif
48+
*.oti binary diff=exif
49+
*.otp binary diff=exif
50+
*.ots binary diff=exif
51+
*.ott binary diff=exif
52+
*.pdf binary diff=exif
53+
*.ppt binary diff=exif
54+
*.pptx binary diff=exif
55+
*.ps binary diff=exif
56+
57+
# Fonts
58+
59+
*.eot binary
60+
*.otf binary diff=exif
61+
*.ttc binary diff=exif
62+
*.ttf binary diff=exif
63+
*.woff binary
64+
*.woff2 binary
65+
66+
# Audio Visual
67+
68+
*.fla binary diff=exif
69+
*.flv binary diff=exif
70+
*.mov binary diff=exif
71+
*.mp3 binary diff=exif
72+
*.mp4 binary diff=exif
73+
*.swf binary diff=exif
74+
75+
# Images
76+
77+
*.ai binary diff=exif
78+
*.bmp binary diff=exif
79+
*.gif binary diff=exif
80+
*.hqx binary
81+
*.icns binary
82+
*.jpeg binary diff=exif
83+
*.jpg binary diff=exif
84+
*.png binary diff=exif
85+
*.psd binary diff=exif
86+
*.svg text
87+
*.tif binary diff=exif
88+
*.tiff binary diff=exif
89+
*.ico binary diff
90+
91+
# Archives
92+
93+
*.7z binary
94+
*.cab binary
95+
*.ear binary
96+
*.gz binary diff=exif
97+
*.jar binary
98+
*.rar binary diff=exif
99+
*.tar binary
100+
*.tgz binary
101+
*.war binary
102+
*.zip binary diff=exif
103+
104+
# turn off delta attributes for large files
105+
# fix large files
106+
# https://stackoverflow.com/a/3096675
107+
/large_file_dir/* -delta
108+
*.psd -delta
109+
/data/*.iso -delta
110+
/some/big/file -delta
111+
another/file/that/is/large -delta

.github/codeql/codeql-config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# documentation https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-a-custom-configuration-file
2+
3+
paths:
4+
- 'packages/**/src/**/*'
5+
paths-ignore:
6+
- '**/*.test*.{ts,js}' # skip test unit
7+
- '**/*.spec*.{ts,js}' # skip test unit
8+
- '**/*.{html,ejs,njk}' # skip non-source files
9+
- '**/dist/**' # skip dist
10+
- '**/node_modules/**' # skip node_modules

.github/dependabot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: 'yarn'
9+
#directory: "/"
10+
#target-branch: 'beta'
11+
schedule:
12+
interval: 'daily'
13+
ignore:
14+
- dependency-name: 'chalk'
15+
versions: ['5.x']
16+
- dependency-name: 'codemirror'
17+
versions: ['6.x']
18+
- dependency-name: 'glob'
19+
- dependency-name: 'prettier'
20+
- dependency-name: 'eslint'
21+
- dependency-name: 'eslint-plugin-prettier'
22+
- dependency-name: 'jsdom'
23+
versions: ['22.x']
24+
- package-ecosystem: 'github-actions'
25+
#target-branch: 'beta'
26+
#directory: "/"
27+
schedule:
28+
interval: 'weekly'
29+
- package-ecosystem: 'gitsubmodule'
30+
#target-branch: 'beta'
31+
schedule:
32+
interval: 'weekly'
33+
#directory: /

.github/workflows/beta-builder.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: Beta Builder
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
secrets:
7+
ACCESS_TOKEN:
8+
required: true
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
env:
14+
NODE_OPTIONS: '--max-old-space-size=8192'
15+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
16+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
17+
node_version: 18.x
18+
cache-key: "my-cache"
19+
cache-paths: |
20+
./packages/sbg-server/src/public
21+
**/.yarn/cache*
22+
**/node_modules
23+
./yarn.lock
24+
**/dist
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
repository: dimaslanjaka/static-blog-generator
30+
ref: master
31+
token: ${{ secrets.ACCESS_TOKEN }}
32+
33+
- name: update submodules
34+
shell: bash
35+
run: |
36+
echo "init submodules"
37+
git submodule init
38+
git submodule foreach "git submodule init"
39+
echo "sync submodules"
40+
git submodule sync
41+
git submodule foreach "git submodule sync"
42+
echo "update submodules"
43+
mkdir -p bin >/dev/null 2>&1
44+
curl -L https://github.com/dimaslanjaka/bin/raw/master/bin/submodule-install > bin/submodule-install
45+
rm -rf .git/modules
46+
bash ./bin/submodule-install
47+
echo "disable githooks warning"
48+
git config advice.ignoredHook false
49+
50+
- name: Set EOL git configs
51+
continue-on-error: true
52+
run: |
53+
git config core.eol lf
54+
git config core.autocrlf input
55+
git checkout-index --force --all
56+
57+
- uses: actions/setup-node@v3
58+
with:
59+
node-version: ${{ env.node_version }}
60+
61+
- name: Set env
62+
id: set-env
63+
shell: bash
64+
run: |
65+
echo "${HOME}/.local/bin" >> $GITHUB_PATH
66+
echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
67+
echo "${GITHUB_WORKSPACE}/node_modules/.bin" >> $GITHUB_PATH
68+
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
69+
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_OUTPUT
70+
echo "GITHUB_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
71+
echo "GITHUB_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
72+
echo "GITHUB_COMMIT_URL=https://github.com/${{github.repository}}/commit/$(echo $GITHUB_SHA)" >> $GITHUB_ENV
73+
echo "GITHUB_COMMIT_URL=https://github.com/${{github.repository}}/commit/$(echo $GITHUB_SHA)" >> $GITHUB_OUTPUT
74+
echo "GITHUB_RUNNER_URL=https://github.com/${{github.repository}}/commit/${{github.sha}}/checks/${{github.run_id}}" >> $GITHUB_ENV
75+
echo "GITHUB_RUNNER_URL=https://github.com/${{github.repository}}/commit/${{github.sha}}/checks/${{github.run_id}}" >> $GITHUB_OUTPUT
76+
echo "CACHE_NPM=$(npm config get cache)" >> $GITHUB_ENV
77+
echo "CACHE_NPM=$(npm config get cache)" >> $GITHUB_OUTPUT
78+
YARN_CURRENT=$(yarn -v)
79+
YARN_BERRY=3.2.1
80+
if [[ "ok" == "$(echo | awk "(${YARN_CURRENT} > ${YARN_BERRY}) { print \"ok\"; }")" ]]; then
81+
echo "CACHE_YARN=$(yarn config get cacheFolder)" >> $GITHUB_ENV
82+
echo "CACHE_YARN=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
83+
else
84+
echo "CACHE_YARN=$(yarn cache dir)" >> $GITHUB_ENV
85+
echo "CACHE_YARN=$(yarn cache dir)" >> $GITHUB_OUTPUT
86+
fi
87+
echo "architecture=$(getconf LONG_BIT)" >> $GITHUB_ENV
88+
if [ -f "package-lock.json" ]; then
89+
echo "PACKAGE-MANAGER=npm" >> $GITHUB_OUTPUT
90+
echo "PACKAGE-MANAGER=npm" >> $GITHUB_ENV
91+
else
92+
echo "PACKAGE-MANAGER=yarn" >> $GITHUB_OUTPUT
93+
echo "PACKAGE-MANAGER=yarn" >> $GITHUB_ENV
94+
fi
95+
unameOut="$(uname -s)"
96+
case "${unameOut}" in
97+
Linux*) machine=linux;;
98+
Darwin*) machine=mac;;
99+
CYGWIN*) machine=cygwin;;
100+
MINGW*) machine=mingw;;
101+
*) machine="unknown:${unameOut}"
102+
esac
103+
echo "machine=$machine" >> $GITHUB_OUTPUT
104+
echo "machine=$machine" >> $GITHUB_ENV
105+
106+
- uses: actions/cache/restore@v3
107+
name: restore caches
108+
id: cache-restore
109+
with:
110+
path: ${{ env.cache-paths }}
111+
key: ${{ env.cache-key }}
112+
113+
- name: Install Global Packages
114+
run: |
115+
corepack enable
116+
yarn dlx npm i -g npm
117+
npm i -g typescript ts-node gulp-cli hexo-cli webpack-cli npm-run-all depcheck lerna husky
118+
119+
- run: yarn install
120+
name: installing
121+
continue-on-error: true
122+
id: install
123+
shell: bash
124+
- name: clean install
125+
if: steps.install.outcome == 'failure'
126+
shell: bash
127+
run: |
128+
yarn cache clean --all
129+
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
130+
truncate -s 0 yarn.lock
131+
YARN_CHECKSUM_BEHAVIOR=update yarn install
132+
- run: yarn run build
133+
shell: bash
134+
name: building
135+
- run: yarn run pack
136+
shell: bash
137+
name: packing
138+
- uses: actions/upload-artifact@v3
139+
name: upload build result
140+
timeout-minutes: 10
141+
with:
142+
if-no-files-found: 'warn'
143+
name: dist-artifact
144+
path: |
145+
./yarn.lock
146+
./packages/**/dist
147+
./packages/**/release*/readme.md
148+
./packages/**/release*/sbg-utility.tgz
149+
./packages/**/release*/sbg-api.tgz
150+
./packages/**/release*/sbg-server.tgz
151+
./packages/**/release*/static-blog-generator.tgz
152+
./packages/**/release*/instant-indexing.tgz
153+
./packages/**/release*/sitemap-crawler.tgz
154+
./packages/sbg-server/src/public
155+
!**/node_modules/**
156+
!**/tmp/**
157+
# overwrite cache key: delete previous and save current
158+
- name: delete previous caches
159+
if: ${{ steps.cache-restore.outputs.cache-hit }}
160+
continue-on-error: true
161+
run: |
162+
gh extension install actions/gh-actions-cache
163+
gh actions-cache delete "${{ env.cache-key }}" --confirm
164+
env:
165+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166+
- uses: actions/cache/save@v3
167+
name: save caches
168+
with:
169+
path: ${{ env.cache-paths }}
170+
key: ${{ env.cache-key }}

.github/workflows/beta-ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Beta CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**/release*/**'
7+
- '**/test'
8+
- '**/package.json'
9+
- '**/yarn.lock'
10+
pull_request:
11+
types:
12+
- closed
13+
workflow_dispatch:
14+
15+
# run single job
16+
concurrency:
17+
group: beta-ci
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build:
22+
uses: ./.github/workflows/beta-builder.yml
23+
secrets:
24+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
25+
test:
26+
needs: build
27+
uses: ./.github/workflows/beta-tester.yml
28+
secrets:
29+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
30+
push:
31+
needs: test
32+
uses: ./.github/workflows/beta-push.yml
33+
secrets:
34+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}

0 commit comments

Comments
 (0)