Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
huideyeren authored Oct 28, 2024
0 parents commit 133dcd2
Show file tree
Hide file tree
Showing 147 changed files with 12,202 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM ghcr.io/huideyeren/vivliostyle-review-docker:latest

RUN pnpm install
RUN bundle install
52 changes: 52 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.0/containers/debian
{
"name": "Re:VIEW",
"build": {
"dockerfile": "Dockerfile",
},

// Set *default* container specific settings.json values on container create.
"settings": {
"editor.renderWhitespace": "all",
"editor.renderControlCharacters": true,
"git.suggestSmartCommit": true,
"textlint.languages": [
"review"
]
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"atsushieno.language-review",
"taichi.vscode-textlint",
"8amjp.charactercount",
"mhutchie.git-graph",
"donjayamanne.githistory",
"felipecaputo.git-project-manager",
"github.vscode-pull-request-github",
"eamodio.gitlens",
"ms-ceintl.vscode-language-pack-ja",
"yzhang.markdown-all-in-one",
"bierner.markdown-mermaid",
"darkriszty.markdown-table-prettify",
"bpruitt-goddard.mermaid-markdown-syntax-highlighting",
"yzane.markdown-pdf",
"christian-kohler.path-intellisense",
"cssho.vscode-svgviewer",
"takanotume24.pdf",
"kisstkondoros.vscode-gutter-preview"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
309 changes: 309 additions & 0 deletions .github/workflows/jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
# This is a basic workflow to help you get started with Actions

name: Build books.

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
SIZE: a6 # 対応はa4, a5, a6, b5, shinsho
# tateが縦組み、yokoが横組み
# config.ymlのdirectionの設定変更も忘れずに。
MUKI: tate
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# reviewdog-github-check:
# name: reviewdogによる簡易校正
# runs-on: ubuntu-latest
# steps:
# #reviewdogのアクション
# - uses: reviewdog/action-setup@v1
# with:
# reviewdog_version: latest

# #textlintを動かすためのnodeアクション
# - uses: actions/setup-node@v4

# - name: リポジトリのチェックアウト
# uses: actions/checkout@v3
# with:
# submodules: recursive

# - name: cache-node-modules
# #stepsが失敗(文章の乱れ)した場合でもcacheを取得するようにする
# uses: pat-s/[email protected]
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.npm
# key: node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# node-

# - name: Install textlint
# run: 'npm install --save-dev textlint textlint-rule-preset-smarthr textlint-rule-prh textlint-plugin-review'

# - name: Install dependent module
# run: npm install

# - name: Execute textlint
# env:
# REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# npx textlint -f checkstyle chapter/*.re wiki/*.md README.md \
# | reviewdog -f=checkstyle -name="textlint" -diff="git diff ${{ github.event.pull_request.base.ref }}" -reporter=github-pr-review -level="error"

epub:
# needs: reviewdog-github-check
name: EPUB版組
runs-on: ubuntu-latest
container:
image: ghcr.io/huideyeren/vivliostyle-review-docker:latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: リポジトリのチェックアウト
uses: actions/checkout@v4
- name: 現在時刻を取得
env:
TZ: "Asia/Tokyo" # タイムゾーンを指定
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H%M')"
# '%Y-%m-%d %H:%M'の部分を書き換えれば、任意の表示に変更できる。
- name: 現在時刻を確認
run: echo ${{ steps.date.outputs.date }} # 2022-01-03 10:42
- name: Node.jsのパッケージをインストール
run: pnpm install
- name: SCSSのコンパイル
run: pnpm run style:${{ env.SIZE }}-${{ env.MUKI }}-no-bleed
- name: Rubyのパッケージをインストール
run: bundle install
- name: Playwrightのインストール
run: ./node_modules/.bin/playwright install --with-deps
- name: EPUBの生成
run: REVIEW_CONFIG_FILE=config-epub-${{ env.MUKI }}.yml bundle exec rake epub
- name: 成果物のアップロード
uses: actions/upload-artifact@v4
with:
name: ${{ format('inokashira-template_{0}_{1}_{2}', 'epub', env.MUKI, steps.date.outputs.date) }}
path: book.epub

print-pdf:
# needs: reviewdog-github-check
name: 塗り足しのある印刷用PDF
runs-on: ubuntu-latest
container:
image: ghcr.io/huideyeren/vivliostyle-review-docker:latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: リポジトリのチェックアウト
uses: actions/checkout@v4
- name: 現在時刻を取得
env:
TZ: "Asia/Tokyo" # タイムゾーンを指定
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H%M')"
# '%Y-%m-%d %H:%M'の部分を書き換えれば、任意の表示に変更できる。
- name: 現在時刻を確認
run: echo ${{ steps.date.outputs.date }} # 2022-01-03 10:42
- name: Node.jsのパッケージをインストール
run: pnpm install
- name: SCSSのコンパイル
run: pnpm run style:${{ env.SIZE }}-${{ env.MUKI }}
- name: Rubyのパッケージをインストール
run: bundle install
- name: Pythonのセットアップ
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: 画像の白黒化
run: |
python -m pip install --upgrade pip
python -m pip install anshitsu
pwd | python grayscaling.py >> .grayscaling.log
- name: 画像白黒化のログ確認
run: cat .grayscaling.log
- name: Playwrightのインストール
run: ./node_modules/.bin/playwright install --with-deps
- name: PDFの生成
run: REVIEW_CONFIG_FILE=config-print-${{ env.MUKI }}.yml REVIEW_VSCLI_USESANDBOX=true REVIEW_VSCLI_GRAYSCALE=true REVIEW_VSCLI_OPTIONS="--timeout 900" bundle exec rake vivliostyle
- name: 成果物のアップロード
uses: actions/upload-artifact@v4
with:
name: ${{ format('inokashira-template_{0}_{1}_{2}', 'print-pdf', env.MUKI, steps.date.outputs.date) }}
path: book.pdf

print-pdf-no-bleed:
# needs: reviewdog-github-check
name: 塗り足しのない印刷用PDF
runs-on: ubuntu-latest
container:
image: ghcr.io/huideyeren/vivliostyle-review-docker:latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: リポジトリのチェックアウト
uses: actions/checkout@v4
- name: 現在時刻を取得
env:
TZ: "Asia/Tokyo" # タイムゾーンを指定
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H%M')"
# '%Y-%m-%d %H:%M'の部分を書き換えれば、任意の表示に変更できる。
- name: 現在時刻を確認
run: echo ${{ steps.date.outputs.date }} # 2022-01-03 10:42
- name: Node.jsのパッケージをインストール
run: pnpm install
- name: SCSSのコンパイル
run: pnpm run style:${{ env.SIZE }}-${{ env.MUKI }}-no-bleed
- name: Rubyのパッケージをインストール
run: bundle install
- name: Pythonのセットアップ
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: 画像の白黒化
run: |
python -m pip install --upgrade pip
python -m pip install anshitsu
pwd | python grayscaling.py >> .grayscaling.log
- name: 画像白黒化のログ確認
run: cat .grayscaling.log
- name: Playwrightのインストール
run: ./node_modules/.bin/playwright install --with-deps
- name: PDFの生成
run: REVIEW_CONFIG_FILE=config-print-${{ env.MUKI }}.yml EVIEW_VSCLI_USESANDBOX=true REVIEW_VSCLI_GRAYSCALE=true bundle exec rake vivliostyle
- name: 成果物のアップロード
uses: actions/upload-artifact@v4
with:
name: ${{ format('inokashira-template_{0}_{1}_{2}', 'print-pdf-no-bleed', env.MUKI, steps.date.outputs.date) }}
path: book.pdf

ebook-pdf:
# needs: reviewdog-github-check
name: 電子書籍用PDF
runs-on: ubuntu-latest
container:
image: ghcr.io/huideyeren/vivliostyle-review-docker:latest
steps:
- name: リポジトリのチェックアウト
uses: actions/checkout@v4
- name: 現在時刻を取得
env:
TZ: "Asia/Tokyo" # タイムゾーンを指定
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H%M')"
# '%Y-%m-%d %H:%M'の部分を書き換えれば、任意の表示に変更できる。
- name: 現在時刻を確認
run: echo ${{ steps.date.outputs.date }} # 2022-01-03 10:42
- name: Node.jsのパッケージをインストール
run: pnpm install
- name: SCSSのコンパイル
run: pnpm run style:${{ env.SIZE }}-${{ env.MUKI }}-no-bleed
- name: Rubyのパッケージをインストール
run: bundle install
- name: Playwrightのインストール
run: ./node_modules/.bin/playwright install --with-deps
- name: PDFの生成
run: REVIEW_CONFIG_FILE=config-ebook-${{ env.MUKI }}.yml REVIEW_VSCLI_USESANDBOX=true REVIEW_VSCLI_OPTIONS="--timeout 900" bundle exec rake vivliostyle
- name: 成果物のアップロード
uses: actions/upload-artifact@v4
with:
name: ${{ format('inokashira-template_{0}_{1}_{2}', 'ebook-pdf', env.MUKI, steps.date.outputs.date) }}
path: book.pdf

udonbook:
# needs: reviewdog-github-check
name: UDON Book用画像
runs-on: ubuntu-latest
container:
image: ghcr.io/huideyeren/vivliostyle-review-docker:latest
steps:
- name: リポジトリのチェックアウト
uses: actions/checkout@v4
- name: 現在時刻を取得
env:
TZ: "Asia/Tokyo" # タイムゾーンを指定
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H%M')"
# '%Y-%m-%d %H:%M'の部分を書き換えれば、任意の表示に変更できる。
- name: 現在時刻を確認
run: echo ${{ steps.date.outputs.date }} # 2022-01-03 10:42
- name: Node.jsのパッケージをインストール
run: pnpm install
- name: SCSSのコンパイル
run: pnpm run style:${{ env.SIZE }}-${{ env.MUKI }}-no-bleed
- name: Rubyのパッケージをインストール
run: bundle install
- name: Playwrightのインストール
run: ./node_modules/.bin/playwright install --with-deps
- name: PDFの生成
run: REVIEW_CONFIG_FILE=config-udonbook-${{ env.MUKI }}.yml REVIEW_VSCLI_USESANDBOX=true REVIEW_VSCLI_OPTIONS="--timeout 900" bundle exec rake vivliostyle
- name: 画像の生成
run: mkdir distimages && cp images/frontcover.png images/backcover.png ./distimages && pdftoppm -png book.pdf ${{ github.repository }} -scale-to-y 1024 && ls -la ./distimages
- name: 成果物のアップロード
uses: actions/upload-artifact@v4
with:
name: ${{ format('inokashira-template_{0}_{1}_{2}', 'udonbook-png', env.MUKI, steps.date.outputs.date) }}
path: ./distimages/*.png

# paper:
# # 校正ツールによるチェックが通らないとダメにするにはチェックを外す
# # needs: reviewdog-github-check
# name: 旧LaTeX版PDF
# runs-on: ubuntu-latest
# container:
# image: ghcr.io/huideyeren/review-docker:latest
# steps:
# - name: リポジトリのチェックアウト
# uses: actions/checkout@v4
# - name: 現在時刻の取得
# env:
# TZ: "Asia/Tokyo" # タイムゾーンを指定
# id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H%M')"
# # '%Y-%m-%d %H:%M'の部分を書き換えれば、任意の表示に変更できる。
# - name: 現在時刻を確認
# run: echo ${{ steps.date.outputs.date }} # 2022-01-03 10:42
# - name: Rubyのパッケージをインストール
# run: bundle install
# - name: Node.jsのパッケージをインストール
# run: npm install
# - name: Playwrightのインストール
# run: ./node_modules/.bin/playwright install
# - name: pdfcropコマンドを使えるようにする
# run: apt install texlive-extra-utils
# - name: PlantUMLのコピー
# run: cp /java/plantuml.jar .
# - name: ツールのチェック
# run: dot -V && blockdiag --version && java -jar plantuml.jar -version
# - name: PlantUMLを図に変換する
# run: pwd | bash ./plantuml.sh >> .plantuml.log
# - name: PlantUMLの変換ログを確認する
# run: cat .plantuml.log
# - name: SVGをPDFに変換する
# run: pwd | python3 svg.py >> .svg.log
# - name: SVGをPDFに変換したときのログを確認する
# run: cat .svg.log
# - name: MermaidのPNG化
# run: ./mmdtopng.sh images/*.mermaid
# - name: 画像の白黒化
# run: pwd | python3 grayscaling.py >> .grayscaling.log
# - name: 画像白黒化のログ確認
# run: cat .grayscaling.log
# - name: PDFの生成
# run: REVIEW_CONFIG_FILE=config-print-pdf.yml bundle exec rake pdf
# - name: 成果物のアップロード
# uses: actions/upload-artifact@v4
# with:
# name: ${{ format('inokashira-template_{0}_{1}_{2}', 'print-pdf', env.MUKI, steps.date.outputs.date) }}
# path: book.pdf

Loading

0 comments on commit 133dcd2

Please sign in to comment.