-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from transky-book/main
- Loading branch information
Showing
781 changed files
with
16,521 additions
and
7,730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# yaml-language-server: $schema=https://huacnlee.github.io/autocorrect/schema.json | ||
textRules: | ||
哆啦A梦: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.md linguist-vendored=false | ||
*.md linguist-generated=false | ||
*.md linguist-documentation=false | ||
*.md linguist-detectable=true |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/.github @Cryolitia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build ebook | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ebook-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- uses: DeterminateSystems/flake-checker-action@main | ||
|
||
- name: Print flake metadata | ||
run: nix flake metadata --accept-flake-config | ||
|
||
- name: Build | ||
run: | | ||
sed -e "s/BUILD_TIME/$(TZ=Asia/Shanghai date -Isecond)/" -e "s/COMMIT_SHA/${{ github.sha }}/" -i src/about.md | ||
NIXPKGS_ALLOW_UNFREE=1 nix build .# --impure --accept-flake-config | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ebook | ||
path: | | ||
result/share/transky-book/book/epub/药娘的天空.epub | ||
result/share/transky-book/book/mobi/药娘的天空.mobi | ||
result/share/transky-book/book/typst-pdf/药娘的天空.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build website | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
pull_request: | ||
|
||
concurrency: | ||
group: web-${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: latest | ||
run_install: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: pnpm | ||
node-version: current | ||
|
||
- name: Build | ||
env: | ||
NODE_OPTIONS: --max_old_space_size=4096 | ||
run: | | ||
sed -e "s/BUILD_TIME/$(TZ=Asia/Shanghai date -Isecond)/" -e "s/COMMIT_SHA/${{ github.sha }}/" -i src/about.md | ||
pnpm run build | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: website | ||
path: src/.vitepress/dist/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: AutoCorrect | ||
uses: huacnlee/autocorrect-action@main | ||
|
||
- name: Report ReviewDog | ||
if: failure() | ||
uses: huacnlee/autocorrect-action@main | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
reviewdog: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Publish website to cloudflare | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- ".github/workflows/build-web.yaml" | ||
- ".github/workflows/publish-cloudflare.yaml" | ||
- ".vitepress/**" | ||
- "src/**" | ||
- "package.json" | ||
- "pnpm-lock.yaml" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-web.yaml | ||
|
||
publish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
environment: cloudflare-pages | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: website | ||
path: website | ||
|
||
- name: Publish to Cloudflare Pages | ||
uses: cloudflare/pages-action@v1 | ||
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }} | ||
projectName: transky-book | ||
directory: website | ||
wranglerVersion: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Publish ebook to release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
- "stable" | ||
paths: | ||
- ".github/workflows/build-ebook.yaml" | ||
- ".github/workflows/publish-release.yaml" | ||
- ".releaserc" | ||
- "src/**" | ||
- "theme/**" | ||
- "book.toml" | ||
- "package.json" | ||
- "pnpm-lock.yaml" | ||
- "flake.nix" | ||
- "flake.lock" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-ebook.yaml | ||
|
||
publish: | ||
permissions: | ||
contents: write | ||
needs: build | ||
if: ${{ !(github.event_name == 'push' && contains(github.event.head_commit.message, '[skip release]')) }} | ||
runs-on: ubuntu-latest | ||
environment: flake | ||
steps: | ||
- name: Generate a token | ||
id: generate-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.TRIGGER_APP_ID }} | ||
private-key: ${{ secrets.TRIGGER_APP_SECRET }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ steps.generate-token.outputs.token }} | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: latest | ||
run_install: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: pnpm | ||
node-version: current | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ebook | ||
path: ebook | ||
|
||
- name: Release ebook | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: pnpm exec semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: "Update flake" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- ".github/workflows/update-flake.yaml" | ||
schedule: | ||
- cron: '31 2 * * 5' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
sync-flake: | ||
runs-on: ubuntu-latest | ||
environment: flake | ||
steps: | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
|
||
- name: Generate a token | ||
id: generate-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.TRIGGER_APP_ID }} | ||
private-key: ${{ secrets.TRIGGER_APP_SECRET }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
token: ${{ steps.generate-token.outputs.token }} | ||
|
||
- name: Setup Git | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git show -s | ||
- name: Update flake | ||
run: | | ||
set +e | ||
nix flake update --accept-flake-config | ||
nix flake info --accept-flake-config | ||
# suppress inactive repo update weekly | ||
git log --pretty=format:"%s" -1 HEAD | grep "dep: flake update" && exit 0 | ||
git add . | ||
git status | ||
git commit -m "dep: flake update $(date +'%Y-%m-%dT%H:%M:%S')" || exit 0 | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
book | ||
src/.vitepress/cache | ||
src/.vitepress/dist | ||
src/.vitepress/.temp | ||
node_modules | ||
result | ||
src/.vitepress/components.d.ts |
Oops, something went wrong.