From cd79260a7b9a49670ebd243c7c00b91f222b2426 Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:52:34 +0900 Subject: [PATCH 01/10] =?UTF-8?q?add:=20pdf=E3=81=AB=E7=B5=84=E7=89=88?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/releasel.yml | 73 ++++++++++++++++++++++++++++++++++ template.tex | 25 ++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 .github/workflows/releasel.yml create mode 100644 template.tex diff --git a/.github/workflows/releasel.yml b/.github/workflows/releasel.yml new file mode 100644 index 0000000..28c1d4c --- /dev/null +++ b/.github/workflows/releasel.yml @@ -0,0 +1,73 @@ +name: Convert Markdown to PDF and Create Release + +on: + workflow_dispatch: # 手動実行を有効にする + push: + branches: + - feature/#6 # デバッグ用 + +jobs: + convert_and_release: + runs-on: ubuntu-latest + + steps: + # リポジトリをチェックアウト + - name: Checkout repository + uses: actions/checkout@v2 + + # pandocをインストール + - name: Install pandoc + run: sudo apt-get install pandoc + + # Markdownファイルのタイトルを抽出 + - name: Extract title from Markdown + id: extract_title + run: | + TITLE=$(head -n 1 constitution.md | sed 's/^# //') + echo "TITLE=$TITLE" >> $GITHUB_ENV + echo "Extracted title: $TITLE" + + # MarkdownからLaTeXファイルに変換 + - name: Convert Markdown to LaTeX + run: | + pandoc -r markdown-auto_identifiers constitution.md -o constitution.tex --template=template.tex -V title="$TITLE" + + # 生成されたLaTeXファイルを表示 + - name: Display constitution.tex content + run: cat constitution.tex + + # LaTeXファイルをDVI形式にコンパイル + - name: Compile constitution.tex to DVI using platex + run: | + docker run --rm -v $PWD:/workdir paperist/alpine-texlive-ja platex /workdir/constitution.tex + + # DVIからPDFを生成 + - name: Generate PDF from DVI using dvipdfmx + run: | + docker run --rm -v $PWD:/workdir paperist/alpine-texlive-ja dvipdfmx /workdir/constitution.dvi + + # Releaseの作成 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + body: | + Compiled PDF ${{ github.ref_name }} + draft: false + prerelease: false + + # 生成されたPDFをReleaseにアップロード + - name: Upload Release Asset + id: upload_release_asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./constitution.pdf + asset_name: constitution.pdf + asset_content_type: application/pdf \ No newline at end of file diff --git a/template.tex b/template.tex new file mode 100644 index 0000000..a34998d --- /dev/null +++ b/template.tex @@ -0,0 +1,25 @@ +\documentclass{article} +\usepackage[top=25truemm, bottom=25truemm, left=20truemm, right=20truemm]{geometry} % 余白設定 +\usepackage[utf8]{inputenc} % UTF-8エンコーディングを使用 +\usepackage[japanese]{babel} % 日本語のサポートを有効にする + +% 目次やリストのレイアウト調整 +\def\tightlist{\itemsep1pt\parskip0pt\parsep0pt} % リストの間隔を調整 + +% タイトル設定 +\title{$title$} % Markdownで定義されたタイトルを挿入 + +% セクション設定(デフォルトの \section ではなく、指定された \section を使う) +\renewcommand{\section}[1]{\vspace{10pt}\noindent \textbf{\large #1}} % セクションの書式変更 + +% サブセクション設定(デフォルトの \subsection を使用しない) +\renewcommand{\subsection}[1]{\vspace{8pt}\noindent \textbf{#1}} % サブセクションの書式変更 + +\begin{document} + +\maketitle % タイトルを出力 + +% 本文部分 +$body$ + +\end{document} \ No newline at end of file From ea2beef6949e81ad72d0cda8f08e8009600516d8 Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:55:36 +0900 Subject: [PATCH 02/10] fix: typo --- .github/workflows/{releasel.yml => release.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{releasel.yml => release.yml} (100%) diff --git a/.github/workflows/releasel.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/releasel.yml rename to .github/workflows/release.yml From 69b1f8c54f22eb241aabb79bdce1c06ca4950686 Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:36:19 +0900 Subject: [PATCH 03/10] Update release.yml --- .github/workflows/release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28c1d4c..8365ed3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,10 +41,10 @@ jobs: run: | docker run --rm -v $PWD:/workdir paperist/alpine-texlive-ja platex /workdir/constitution.tex - # DVIからPDFを生成 - - name: Generate PDF from DVI using dvipdfmx + # LuaLaTeXでPDFを生成 + - name: Compile LaTeX to PDF using LuaLaTeX run: | - docker run --rm -v $PWD:/workdir paperist/alpine-texlive-ja dvipdfmx /workdir/constitution.dvi + docker run --rm -v $PWD:/workdir paperist/alpine-texlive-ja lualatex -output-directory=/workdir /workdir/constitution.tex # Releaseの作成 - name: Create Release @@ -53,10 +53,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref_name }} - release_name: Release ${{ github.ref_name }} + tag_name: "release-${{ github.sha }}-${{ github.run_id }}" + release_name: "$Release {{ env.CURRENT_DATETIME }}" body: | - Compiled PDF ${{ github.ref_name }} + Compiled PDF draft: false prerelease: false @@ -70,4 +70,4 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./constitution.pdf asset_name: constitution.pdf - asset_content_type: application/pdf \ No newline at end of file + asset_content_type: application/pdf From b2381039cd9945df3c692dad8eb0c1b4e1d9d9af Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:40:19 +0900 Subject: [PATCH 04/10] =?UTF-8?q?fix:=20LuaLatex=E3=81=A7=E6=97=A5?= =?UTF-8?q?=E6=9C=AC=E8=AA=9E=E3=82=92=E7=B5=84=E7=89=88=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/template.tex b/template.tex index a34998d..e5ed331 100644 --- a/template.tex +++ b/template.tex @@ -1,7 +1,8 @@ -\documentclass{article} +\documentclass{ltjsarticle} \usepackage[top=25truemm, bottom=25truemm, left=20truemm, right=20truemm]{geometry} % 余白設定 \usepackage[utf8]{inputenc} % UTF-8エンコーディングを使用 \usepackage[japanese]{babel} % 日本語のサポートを有効にする +\usepackage{luatexja-preset} % 日本語サポートを有効化 % 目次やリストのレイアウト調整 \def\tightlist{\itemsep1pt\parskip0pt\parsep0pt} % リストの間隔を調整 @@ -22,4 +23,4 @@ % 本文部分 $body$ -\end{document} \ No newline at end of file +\end{document} From 80387c83f909bbb4747469be1c2c3648101c4dfc Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:43:37 +0900 Subject: [PATCH 05/10] =?UTF-8?q?fix:=20dvi=E3=82=B3=E3=83=B3=E3=83=91?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E5=87=A6=E7=90=86=E3=81=AF=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E3=81=AA=E3=81=AE=E3=81=A7=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8365ed3..d6e3193 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,11 +36,6 @@ jobs: - name: Display constitution.tex content run: cat constitution.tex - # LaTeXファイルをDVI形式にコンパイル - - name: Compile constitution.tex to DVI using platex - run: | - docker run --rm -v $PWD:/workdir paperist/alpine-texlive-ja platex /workdir/constitution.tex - # LuaLaTeXでPDFを生成 - name: Compile LaTeX to PDF using LuaLaTeX run: | From 71824da35df3c179c584621df852987c5c580f09 Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:48:32 +0900 Subject: [PATCH 06/10] =?UTF-8?q?fix:=20=E3=83=AA=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E5=90=8D=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6e3193..dc0af4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: "release-${{ github.sha }}-${{ github.run_id }}" - release_name: "$Release {{ env.CURRENT_DATETIME }}" + release_name: "Release {{ env.CURRENT_DATETIME }}" body: | Compiled PDF draft: false From 7c4edc77e0fc1e64b42aa1e889ae1e25cf453243 Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:52:27 +0900 Subject: [PATCH 07/10] =?UTF-8?q?fix:=20=E7=8F=BE=E5=9C=A8=E6=99=82?= =?UTF-8?q?=E5=88=BB=E3=82=92=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc0af4b..0b2e265 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,12 @@ jobs: run: | docker run --rm -v $PWD:/workdir paperist/alpine-texlive-ja lualatex -output-directory=/workdir /workdir/constitution.tex + # 現在時刻を取得 + - name: Set current datetime as env variable + env: + TZ: 'Asia/Tokyo' # タイムゾーン指定 + run: echo "CURRENT_DATETIME=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV + # Releaseの作成 - name: Create Release id: create_release From 8f05aaf5591f75d986884c03effe65edb15194b8 Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:56:40 +0900 Subject: [PATCH 08/10] fix: $ --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b2e265..b3612c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,7 +55,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: "release-${{ github.sha }}-${{ github.run_id }}" - release_name: "Release {{ env.CURRENT_DATETIME }}" + release_name: "Release ${{ env.CURRENT_DATETIME }}" body: | Compiled PDF draft: false From a8bc761b51e115e75d6ea24566c17ba1ac80fe20 Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 18:02:40 +0900 Subject: [PATCH 09/10] =?UTF-8?q?fix:=20jlreq=E3=81=A7=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=B3=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/template.tex b/template.tex index e5ed331..735eda3 100644 --- a/template.tex +++ b/template.tex @@ -1,8 +1,9 @@ -\documentclass{ltjsarticle} +\documentclass[fontspec]{jlreq} % LuaLaTeX専用 \usepackage[top=25truemm, bottom=25truemm, left=20truemm, right=20truemm]{geometry} % 余白設定 \usepackage[utf8]{inputenc} % UTF-8エンコーディングを使用 \usepackage[japanese]{babel} % 日本語のサポートを有効にする -\usepackage{luatexja-preset} % 日本語サポートを有効化 +\usepackage{luatexja-fontspec} % 日本語フォント指定用 +\setmainjfont{Noto Serif JP} % 日本語フォントの指定 % 目次やリストのレイアウト調整 \def\tightlist{\itemsep1pt\parskip0pt\parsep0pt} % リストの間隔を調整 From 02cc23ab3aa37a06b624af3f1a6ae0cf9a889ff2 Mon Sep 17 00:00:00 2001 From: dokudami <69578376+ysdzm@users.noreply.github.com> Date: Fri, 29 Nov 2024 18:17:52 +0900 Subject: [PATCH 10/10] =?UTF-8?q?fix:=20=E6=88=BB=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template.tex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/template.tex b/template.tex index 735eda3..e5ed331 100644 --- a/template.tex +++ b/template.tex @@ -1,9 +1,8 @@ -\documentclass[fontspec]{jlreq} % LuaLaTeX専用 +\documentclass{ltjsarticle} \usepackage[top=25truemm, bottom=25truemm, left=20truemm, right=20truemm]{geometry} % 余白設定 \usepackage[utf8]{inputenc} % UTF-8エンコーディングを使用 \usepackage[japanese]{babel} % 日本語のサポートを有効にする -\usepackage{luatexja-fontspec} % 日本語フォント指定用 -\setmainjfont{Noto Serif JP} % 日本語フォントの指定 +\usepackage{luatexja-preset} % 日本語サポートを有効化 % 目次やリストのレイアウト調整 \def\tightlist{\itemsep1pt\parskip0pt\parsep0pt} % リストの間隔を調整