From 391c173fde6baa6b6ac1bc20ce7a688f72db29e8 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Sun, 17 Oct 2021 19:44:48 +0900 Subject: [PATCH 01/24] build on ci --- .github/workflows/build.yaml | 17 +++++++++++++++++ docker/Dockerfile | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..65b55fa --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,17 @@ +name: build bushi +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: build docker + run: docker build docker -t bushi:latest + - name: build pdf + run: docker run --mount type=bind,source="$(pwd)",target=/workdir bushi:latest + - name: save artifact + uses: actions/upload-artifact@v2 + with: + name: bushi.pdf + path: out/bushi.pdf diff --git a/docker/Dockerfile b/docker/Dockerfile index e570bec..abcd521 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM arch-texlive-ja +FROM ghcr.io/kmc-jp/arch-texlive-ja:latest RUN pacman -Sy --noconfirm && \ pacman -S --noconfirm ruby pandoc adobe-source-sans-fonts From 3c07c5fa85129001086c6073980be7596dc58fb3 Mon Sep 17 00:00:00 2001 From: ikubaku Date: Mon, 18 Oct 2021 18:08:04 +0900 Subject: [PATCH 02/24] =?UTF-8?q?=E9=9B=91=E3=81=AB=E7=B5=B5=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E3=82=BF=E3=82=A4=E3=83=97=E3=82=BB=E3=83=83?= =?UTF-8?q?=E3=83=88=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile | 2 +- luakmcbook.dtx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index abcd521..0e24874 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,7 @@ FROM ghcr.io/kmc-jp/arch-texlive-ja:latest RUN pacman -Sy --noconfirm && \ - pacman -S --noconfirm ruby pandoc adobe-source-sans-fonts + pacman -S --noconfirm ruby pandoc adobe-source-sans-fonts noto-fonts-emoji RUN tlmgr update --self RUN tlmgr install adfsymbols ulem lualatex-math diff --git a/luakmcbook.dtx b/luakmcbook.dtx index 249fa57..d5b3d46 100644 --- a/luakmcbook.dtx +++ b/luakmcbook.dtx @@ -69,9 +69,16 @@ % 改頁なしのinclude等を提供 \usepackage{newclude} +% 絵文字を直接タイプセットしたいので +\directlua{luaotfload.add_fallback + ("emojifallback", { + "NotoColorEmoji:mode=harf;" + }) +} + % 欧文フォントを変更 \usepackage{fontspec} -\setmainfont[Scale=1]{Linux Libertine O} % セリフ体 +\setmainfont[Scale=1, RawFeature={fallback=emojifallback}]{Linux Libertine O} % セリフ体と絵文字 \setsansfont[Scale=1.05]{Source Sans Pro} % サンセリフ体 % 校正規約はこれがないと組めなかった From 2a45eb2046ae24007bed96e116f0d465b8414b99 Mon Sep 17 00:00:00 2001 From: ikubaku Date: Mon, 18 Oct 2021 21:01:02 +0900 Subject: [PATCH 03/24] Fallback to emoji font on sans serif and monospace styles --- docker/Dockerfile | 3 ++- luakmcbook.dtx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0e24874..86a2bf0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,8 @@ FROM ghcr.io/kmc-jp/arch-texlive-ja:latest RUN pacman -Sy --noconfirm && \ - pacman -S --noconfirm ruby pandoc adobe-source-sans-fonts noto-fonts-emoji + pacman -S --noconfirm \ + ruby pandoc adobe-source-sans-fonts noto-fonts-emoji adobe-source-code-pro-fonts RUN tlmgr update --self RUN tlmgr install adfsymbols ulem lualatex-math diff --git a/luakmcbook.dtx b/luakmcbook.dtx index d5b3d46..78424d2 100644 --- a/luakmcbook.dtx +++ b/luakmcbook.dtx @@ -79,7 +79,8 @@ % 欧文フォントを変更 \usepackage{fontspec} \setmainfont[Scale=1, RawFeature={fallback=emojifallback}]{Linux Libertine O} % セリフ体と絵文字 -\setsansfont[Scale=1.05]{Source Sans Pro} % サンセリフ体 +\setsansfont[Scale=1.05, RawFeature={fallback=emojifallback}]{Source Sans Pro} % サンセリフ体と絵文字 +\setmonofont[Scale=1, RawFeature={fallback=emojifallback}]{Source Code Pro} % 等幅と絵文字 % 校正規約はこれがないと組めなかった \usepackage{booktabs} From 47d76e7a9771d94435c16b70ac6954acc93e4f1d Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Thu, 21 Oct 2021 18:51:41 +0900 Subject: [PATCH 04/24] debug code --- build.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.rb b/build.rb index 1afc79a..127747f 100644 --- a/build.rb +++ b/build.rb @@ -23,8 +23,10 @@ Dir.glob('kiji/**/*') do |file| if FileTest.file? file then outfile = file.sub(/^kiji\//, '').sub(/.md$/, '.tex') - system("#{PANDOC} -o out/#{outfile} #{file}") - puts $? if $? + cmd = "#{PANDOC} -o out/#{outfile} #{file}" + puts "exec: #{cmd}" + system(cmd) + puts "exit code: #{$?}" if $? end end From 767c748d780df1e431b024f6c2be7d1a42801b44 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Fri, 22 Oct 2021 19:07:32 +0900 Subject: [PATCH 05/24] use debian texlive base image --- docker/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 86a2bf0..580be25 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,9 @@ -FROM ghcr.io/kmc-jp/arch-texlive-ja:latest +FROM ghcr.io/paperist/texlive-ja:debian -RUN pacman -Sy --noconfirm && \ - pacman -S --noconfirm \ - ruby pandoc adobe-source-sans-fonts noto-fonts-emoji adobe-source-code-pro-fonts +RUN apt-get install -y \ + ruby \ + pandoc \ + fonts-noto-cjk-extra fonts-noto-color-emoji RUN tlmgr update --self RUN tlmgr install adfsymbols ulem lualatex-math From 22dd9893a644855cbdf2192da0a33c3d0b1aea56 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Fri, 22 Oct 2021 19:10:47 +0900 Subject: [PATCH 06/24] update --- docker/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 580be25..0df970e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,11 @@ FROM ghcr.io/paperist/texlive-ja:debian -RUN apt-get install -y \ +RUN apt-get update \ + && apt-get install -y \ ruby \ pandoc \ - fonts-noto-cjk-extra fonts-noto-color-emoji + fonts-noto-cjk-extra fonts-noto-color-emoji \ + && rm -rf /var/lib/apt/lists/* RUN tlmgr update --self RUN tlmgr install adfsymbols ulem lualatex-math From c7fa2cdca52bbc20a948969bd01e60bcdb45ea1e Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Fri, 22 Oct 2021 19:17:22 +0900 Subject: [PATCH 07/24] skip when not md --- build.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/build.rb b/build.rb index 127747f..1617cc6 100644 --- a/build.rb +++ b/build.rb @@ -22,6 +22,7 @@ # MarkdownをTeXに変換 Dir.glob('kiji/**/*') do |file| if FileTest.file? file then + next if file =~ /.md$/ outfile = file.sub(/^kiji\//, '').sub(/.md$/, '.tex') cmd = "#{PANDOC} -o out/#{outfile} #{file}" puts "exec: #{cmd}" From b603da2d96407936ee1c9d91114a10c96699fd99 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Fri, 22 Oct 2021 19:22:27 +0900 Subject: [PATCH 08/24] unless --- build.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.rb b/build.rb index 1617cc6..391a179 100644 --- a/build.rb +++ b/build.rb @@ -22,8 +22,8 @@ # MarkdownをTeXに変換 Dir.glob('kiji/**/*') do |file| if FileTest.file? file then - next if file =~ /.md$/ - outfile = file.sub(/^kiji\//, '').sub(/.md$/, '.tex') + next unless file =~ /\.md$/ + outfile = file.sub(/^kiji\//, '').sub(/\.md$/, '.tex') cmd = "#{PANDOC} -o out/#{outfile} #{file}" puts "exec: #{cmd}" system(cmd) From caae694da27bb0088b93342ec7f09fac5233c296 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Sat, 23 Oct 2021 20:00:18 +0900 Subject: [PATCH 09/24] kouka? --- docker/Dockerfile | 14 ++++++++++++++ luakmcbook.dtx | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0df970e..0eba16a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,10 +3,24 @@ FROM ghcr.io/paperist/texlive-ja:debian RUN apt-get update \ && apt-get install -y \ ruby \ + fontconfig \ pandoc \ fonts-noto-cjk-extra fonts-noto-color-emoji \ && rm -rf /var/lib/apt/lists/* +RUN mkdir -p /usr/local/share/fonts/ \ + && cd /tmp \ + && wget https://github.com/adobe-fonts/source-sans/releases/download/3.046R/TTF-source-sans-3.046R.zip -O /tmp/sourceSans.zip \ + && unzip /tmp/sourceSans.zip \ + && wget https://github.com/adobe-fonts/source-code-pro/releases/download/2.038R-ro%2F1.058R-it%2F1.018R-VAR/TTF-source-code-pro-2.038R-ro-1.058R-it.zip -O /tmp/sourceCourde.zip \ + && unzip /tmp/sourceCourde.zip -d /tmp/TTF \ + && mv /tmp/TTF/*.ttf /usr/local/share/fonts/ \ + && wget https://github.com/adobe-fonts/source-han-sans/releases/download/2.004R/SourceHanSansJP.zip -O /tmp/SourceHanSansJP.zip \ + && unzip /tmp/SourceHanSansJP.zip \ + && mv /tmp/SubsetOTF/JP/*.otf /usr/local/share/fonts/ \ + && fc-cache \ + && rm -rf /tmp/* + RUN tlmgr update --self RUN tlmgr install adfsymbols ulem lualatex-math diff --git a/luakmcbook.dtx b/luakmcbook.dtx index 78424d2..1796e0e 100644 --- a/luakmcbook.dtx +++ b/luakmcbook.dtx @@ -79,7 +79,7 @@ % 欧文フォントを変更 \usepackage{fontspec} \setmainfont[Scale=1, RawFeature={fallback=emojifallback}]{Linux Libertine O} % セリフ体と絵文字 -\setsansfont[Scale=1.05, RawFeature={fallback=emojifallback}]{Source Sans Pro} % サンセリフ体と絵文字 +\setsansfont[Scale=1.05, RawFeature={fallback=emojifallback}]{Source Han Sans JP} % サンセリフ体と絵文字 \setmonofont[Scale=1, RawFeature={fallback=emojifallback}]{Source Code Pro} % 等幅と絵文字 % 校正規約はこれがないと組めなかった From e4dd6351e6dee9a213b383ab1d08eb8f141f8b8d Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Sun, 24 Oct 2021 23:42:35 +0900 Subject: [PATCH 10/24] build and push when tag pushed --- .github/workflows/build.yaml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 65b55fa..cf574c7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,17 +1,26 @@ name: build bushi -on: push +on: + push: tags jobs: build: runs-on: ubuntu-latest steps: + - name: get tag + id: variables + run: echo "::set-output name=tag::${GITHUB_REF##*/}" - name: Check out the repo uses: actions/checkout@v2 - - name: build docker - run: docker build docker -t bushi:latest - - name: build pdf - run: docker run --mount type=bind,source="$(pwd)",target=/workdir bushi:latest - - name: save artifact - uses: actions/upload-artifact@v2 + - name: Log in to GitHub Docker Registry + uses: docker/login-action@v1 with: - name: bushi.pdf - path: out/bushi.pdf + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build container image + uses: docker/build-push-action@v2 + with: + context: docker + push: true + tags: + - ghcr.io/${{ github.repository_owner }}/bushi-build-image:latest + - ghcr.io/${{ github.repository_owner }}/bushi-build-image:${{ steps.variables.outputs.tag }} From 04323cf51f2bc9c471570a280061877ae39c0bed Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Sun, 24 Oct 2021 23:44:49 +0900 Subject: [PATCH 11/24] on push --- .github/workflows/build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cf574c7..9d43869 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,8 @@ name: build bushi on: - push: tags + push: + tags: + - '*' jobs: build: runs-on: ubuntu-latest From f00179491afdc21a4901b24b173605d8c13ec3dc Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Sun, 24 Oct 2021 23:48:12 +0900 Subject: [PATCH 12/24] multiple tags --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9d43869..5f7209a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,6 +23,6 @@ jobs: with: context: docker push: true - tags: - - ghcr.io/${{ github.repository_owner }}/bushi-build-image:latest - - ghcr.io/${{ github.repository_owner }}/bushi-build-image:${{ steps.variables.outputs.tag }} + tags: | + ghcr.io/${{ github.repository_owner }}/bushi-build-image:latest + ghcr.io/${{ github.repository_owner }}/bushi-build-image:${{ steps.variables.outputs.tag }} From 91d03662b5f4ec2888081866a00772046c800eff Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Sun, 24 Oct 2021 23:55:10 +0900 Subject: [PATCH 13/24] this is image create workflow --- .github/workflows/{build.yaml => image.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{build.yaml => image.yaml} (95%) diff --git a/.github/workflows/build.yaml b/.github/workflows/image.yaml similarity index 95% rename from .github/workflows/build.yaml rename to .github/workflows/image.yaml index 5f7209a..0ca4739 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/image.yaml @@ -1,4 +1,4 @@ -name: build bushi +name: build and push bushi build image on: push: tags: From a2bc208676faf229284954457b3ba1e85d1e8eb1 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Wed, 27 Oct 2021 22:03:00 +0900 Subject: [PATCH 14/24] add build.yaml --- .github/workflows/build.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..43cb08c --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,21 @@ +name: build bushi +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: build pdf + run: docker run --mount type=bind,source="$(pwd)",target=/workdir ghcr.io/kmc-jp/bushi-build-image:latest + - name: save log + uses: actions/upload-artifact@v2 + with: + name: log + path: out/*.log + - name: save artifact + uses: actions/upload-artifact@v2 + with: + name: bushi.pdf + path: out/bushi.pdf + if-no-files-found: error From 522a4ea8cfd2fe4ab05d77c3bc264d37735fd11a Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Mon, 1 Nov 2021 18:46:11 +0900 Subject: [PATCH 15/24] install pandoc-corssref --- docker/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0eba16a..b85dff3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,6 +21,13 @@ RUN mkdir -p /usr/local/share/fonts/ \ && fc-cache \ && rm -rf /tmp/* +RUN cd /tmp \ + && wget https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.12.0d/pandoc-crossref-Linux.tar.xz -O pandoc-crossref-Linux.tar.xz \ + && tar xf pandoc-crossref-Linux.tar.xz \ + && chmod +x pandoc-crossref \ + && mv pandoc-crossref /usr/local/bin \ + && rm -rf /tmp/* + RUN tlmgr update --self RUN tlmgr install adfsymbols ulem lualatex-math From 224e88995f11c0d8038dffe41a877cd8bb1d7e2e Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Mon, 1 Nov 2021 18:51:43 +0900 Subject: [PATCH 16/24] need xz-utils --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index b85dff3..0958b57 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,6 +6,7 @@ RUN apt-get update \ fontconfig \ pandoc \ fonts-noto-cjk-extra fonts-noto-color-emoji \ + xz-utils \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /usr/local/share/fonts/ \ From 7f06a32d2a6db41b2dc9ce757c6a9588a37b4271 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Mon, 1 Nov 2021 19:02:45 +0900 Subject: [PATCH 17/24] fail on subcommand failed --- build.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.rb b/build.rb index 391a179..083c258 100644 --- a/build.rb +++ b/build.rb @@ -28,6 +28,7 @@ puts "exec: #{cmd}" system(cmd) puts "exit code: #{$?}" if $? + exit $? if $?.to_i > 0 end end @@ -36,5 +37,6 @@ FileUtils.cd("out") do system("latexmk -lualatex bushi.tex") puts $? if $? + exit $? if $?.to_i > 0 end From c40791e81a28798d3c95f3fbd2fc2edf93d57361 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Mon, 1 Nov 2021 19:06:04 +0900 Subject: [PATCH 18/24] install pandoc latest --- docker/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0958b57..0c6e190 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,7 +4,6 @@ RUN apt-get update \ && apt-get install -y \ ruby \ fontconfig \ - pandoc \ fonts-noto-cjk-extra fonts-noto-color-emoji \ xz-utils \ && rm -rf /var/lib/apt/lists/* @@ -22,6 +21,11 @@ RUN mkdir -p /usr/local/share/fonts/ \ && fc-cache \ && rm -rf /tmp/* +RUN cd /tmp \ + && wget https://github.com/jgm/pandoc/releases/download/2.16/pandoc-2.16-1-amd64.deb -O pandoc.deb \ + && dpkg -i pandoc.deb \ + && rm -rf /tmp/* + RUN cd /tmp \ && wget https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.12.0d/pandoc-crossref-Linux.tar.xz -O pandoc-crossref-Linux.tar.xz \ && tar xf pandoc-crossref-Linux.tar.xz \ From f59768a73c536e87da176762456f6cb385fc7c39 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Mon, 1 Nov 2021 19:11:03 +0900 Subject: [PATCH 19/24] convert indent tab to space --- docker/Dockerfile | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0c6e190..635f17e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,37 +1,37 @@ FROM ghcr.io/paperist/texlive-ja:debian RUN apt-get update \ - && apt-get install -y \ - ruby \ - fontconfig \ - fonts-noto-cjk-extra fonts-noto-color-emoji \ - xz-utils \ - && rm -rf /var/lib/apt/lists/* + && apt-get install -y \ + ruby \ + fontconfig \ + fonts-noto-cjk-extra fonts-noto-color-emoji \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* RUN mkdir -p /usr/local/share/fonts/ \ && cd /tmp \ && wget https://github.com/adobe-fonts/source-sans/releases/download/3.046R/TTF-source-sans-3.046R.zip -O /tmp/sourceSans.zip \ - && unzip /tmp/sourceSans.zip \ - && wget https://github.com/adobe-fonts/source-code-pro/releases/download/2.038R-ro%2F1.058R-it%2F1.018R-VAR/TTF-source-code-pro-2.038R-ro-1.058R-it.zip -O /tmp/sourceCourde.zip \ - && unzip /tmp/sourceCourde.zip -d /tmp/TTF \ - && mv /tmp/TTF/*.ttf /usr/local/share/fonts/ \ - && wget https://github.com/adobe-fonts/source-han-sans/releases/download/2.004R/SourceHanSansJP.zip -O /tmp/SourceHanSansJP.zip \ - && unzip /tmp/SourceHanSansJP.zip \ - && mv /tmp/SubsetOTF/JP/*.otf /usr/local/share/fonts/ \ - && fc-cache \ - && rm -rf /tmp/* + && unzip /tmp/sourceSans.zip \ + && wget https://github.com/adobe-fonts/source-code-pro/releases/download/2.038R-ro%2F1.058R-it%2F1.018R-VAR/TTF-source-code-pro-2.038R-ro-1.058R-it.zip -O /tmp/sourceCourde.zip \ + && unzip /tmp/sourceCourde.zip -d /tmp/TTF \ + && mv /tmp/TTF/*.ttf /usr/local/share/fonts/ \ + && wget https://github.com/adobe-fonts/source-han-sans/releases/download/2.004R/SourceHanSansJP.zip -O /tmp/SourceHanSansJP.zip \ + && unzip /tmp/SourceHanSansJP.zip \ + && mv /tmp/SubsetOTF/JP/*.otf /usr/local/share/fonts/ \ + && fc-cache \ + && rm -rf /tmp/* RUN cd /tmp \ - && wget https://github.com/jgm/pandoc/releases/download/2.16/pandoc-2.16-1-amd64.deb -O pandoc.deb \ - && dpkg -i pandoc.deb \ - && rm -rf /tmp/* + && wget https://github.com/jgm/pandoc/releases/download/2.16/pandoc-2.16-1-amd64.deb -O pandoc.deb \ + && dpkg -i pandoc.deb \ + && rm -rf /tmp/* RUN cd /tmp \ - && wget https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.12.0d/pandoc-crossref-Linux.tar.xz -O pandoc-crossref-Linux.tar.xz \ - && tar xf pandoc-crossref-Linux.tar.xz \ - && chmod +x pandoc-crossref \ - && mv pandoc-crossref /usr/local/bin \ - && rm -rf /tmp/* + && wget https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.12.0d/pandoc-crossref-Linux.tar.xz -O pandoc-crossref-Linux.tar.xz \ + && tar xf pandoc-crossref-Linux.tar.xz \ + && chmod +x pandoc-crossref \ + && mv pandoc-crossref /usr/local/bin \ + && rm -rf /tmp/* RUN tlmgr update --self RUN tlmgr install adfsymbols ulem lualatex-math From 80c109658d09318b0b9361a2b6a9c6ecdc78ce68 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Mon, 1 Nov 2021 22:55:05 +0900 Subject: [PATCH 20/24] make image if only tag name begins with image/* --- .github/workflows/image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index 0ca4739..ec426ae 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -2,7 +2,7 @@ name: build and push bushi build image on: push: tags: - - '*' + - 'image/*' jobs: build: runs-on: ubuntu-latest From f7db946055535b96ce7fe7732f2a80cdffcbb693 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Mon, 1 Nov 2021 23:45:35 +0900 Subject: [PATCH 21/24] add release setting --- .github/workflows/release.yaml | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..0345d45 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,36 @@ +name: build bushi and make release on tag pushed +on: + push: + tags: + - 'kiji/*' +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: get tag + id: variables + run: echo "::set-output name=tag::${GITHUB_REF##*/}" + - name: Check out the repo + uses: actions/checkout@v2 + - name: build pdf + run: docker run --mount type=bind,source="$(pwd)",target=/workdir ghcr.io/kmc-jp/bushi-build-image:latest + - name: save log + uses: actions/upload-artifact@v2 + with: + name: log + path: out/*.log + - name: save artifact + uses: actions/upload-artifact@v2 + with: + name: bushi.pdf + path: out/bushi.pdf + if-no-files-found: error + - name: create release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: ${{ steps.variables.outputs.tag }} + prerelease: false + title: ${{ steps.variables.outputs.tag }} + files: | + out/bushi.pdf From 251c8eacb81a38007ccfc8d8c87b87cb96a98924 Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Mon, 1 Nov 2021 23:54:40 +0900 Subject: [PATCH 22/24] write readme --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 98680d3..81ca217 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,31 @@ Xで出す部誌のリポジトリ ---- # タイプセットする方法 -TODO: dockerを使ったタイプセットの説明を書く +dockerだと +``` +docker run --mount type=bind,source="$(pwd)",target=/workdir ghcr.io/kmc-jp/bushi-build-image:latest +``` +そうでない時は単に ``` $ ruby build.rb ``` - TeXLive, ruby, pandoc(ver. 2)のインストールが必要です +## dockerのimageの更新方法 +.github/workflows/image.yaml でimageを作成しています。 +`image/` から始まるtagをpushすると自動で作成されます。 + +forkした先でtagをpushしても動作するとは思いますが、 +ややこしいので https://github.com/kmc-jp/bushi-template2 へのtagのpushで作成して欲しいです。 + +https://github.com/kmc-jp/bushi-template2/pkgs/container/bushi-build-image にimageのリストがあります。 + +## 記事のタグ +.github/workflows/release.yaml で `kiji/` から始まるタグがpushされた際にreleaseを作成しています。 +こちらは、imageとは異なり、fork先のレポジトリでリリース版を作成する時とかに使うことを想定しています。 + # 記事を書く人へ 記事はMarkdown形式で書いてください。 From 3e9cf0ffc53d6257348e51af16f39bed26f0547b Mon Sep 17 00:00:00 2001 From: Kugayama Nana Date: Sun, 7 Nov 2021 02:59:31 +0900 Subject: [PATCH 23/24] update readme --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 81ca217..16dd90a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,14 @@ $ ruby build.rb - TeXLive, ruby, pandoc(ver. 2)のインストールが必要です +## CIによるタイプセット +レポジトリにpushすると、CIによりタイプセットが行なわれて、pdfが自動で生成されます。 +正常にタイプセットできた場合、GitHub Actionsのrun結果のページを開くと、 +artifactにbushi.pdfという項目があります。 +[![Image from Gyazo](https://i.gyazo.com/9cc637c1b1db1eff9e169585df6fcaca.png)](https://gyazo.com/9cc637c1b1db1eff9e169585df6fcaca) + +これは、.github/workflows/build.yamlにて行なっています。 + ## dockerのimageの更新方法 .github/workflows/image.yaml でimageを作成しています。 `image/` から始まるtagをpushすると自動で作成されます。 From 73d784e63ed07e73dc3258ceb306c0eefaed8b06 Mon Sep 17 00:00:00 2001 From: ikubaku Date: Tue, 16 Nov 2021 18:59:19 +0900 Subject: [PATCH 24/24] Change the release tag criteria --- .github/workflows/release.yaml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0345d45..d8d9ae8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,7 +2,7 @@ name: build bushi and make release on tag pushed on: push: tags: - - 'kiji/*' + - 'rel/*' jobs: build: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 16dd90a..609b3b5 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ forkした先でtagをpushしても動作するとは思いますが、 https://github.com/kmc-jp/bushi-template2/pkgs/container/bushi-build-image にimageのリストがあります。 ## 記事のタグ -.github/workflows/release.yaml で `kiji/` から始まるタグがpushされた際にreleaseを作成しています。 +.github/workflows/release.yaml で `rel/` から始まるタグがpushされた際にreleaseを作成しています。 こちらは、imageとは異なり、fork先のレポジトリでリリース版を作成する時とかに使うことを想定しています。 # 記事を書く人へ