-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
104 additions
and
1 deletion.
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,62 @@ | ||
name: typeset | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: get current date | ||
id: date | ||
run: | | ||
echo "date=$(TZ=TIME_ZONE date +'%Y%m%d')" >$GITHUB_OUTPUT | ||
- name: get counter | ||
id: counter | ||
run: | | ||
LAST_RELEASE=$(gh release view --json=tagName | jq -r '.tagName') | ||
LAST_DATE=$(echo $LAST_RELEASE|sed 's/-.*$//') | ||
LAST_COUNTER=$(echo $LAST_RELEASE|sed 's/.*-*//') | ||
if [ "$LAST_DATE" = "$DATE" ] | ||
then | ||
echo "counter=$(($LAST_COUNTER +1))" >$GITHUB_OUTPUT | ||
else | ||
echo "counter=1" >$GITHUB_OUTPUT | ||
fi | ||
env: | ||
DATE: ${{ steps.date.outputs.date }} | ||
GH_TOKEN: ${{ github.token }} | ||
TIME_ZONE: JST-9 # Specify time zone here | ||
- name: get version | ||
id: version | ||
run: | | ||
echo "version=${{ steps.date.outputs.date }}-${{ steps.counter.outputs.counter }}" >$GITHUB_OUTPUT | ||
- name: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: build | ||
run: docker-compose build | ||
- name: run tex | ||
run: docker-compose run tex | ||
- name: release | ||
uses: actions/create-release@v1 | ||
id: create_release | ||
with: | ||
draft: false | ||
prerelease: false | ||
release_name: Release ${{ steps.version.outputs.version }} | ||
tag_name: ${{ steps.version.outputs.version }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: upload asset | ||
id: upload-release-asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./build/sample.pdf # The resulting pdf file | ||
asset_name: sample-${{ steps.version.outputs.version }}.pdf | ||
asset_content_type: application/zip |
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,12 @@ | ||
FROM blang/latex:ubuntu | ||
|
||
RUN apt update -y | ||
RUN apt install -y tzdata | ||
|
||
RUN mkdir /work | ||
RUN mkdir /work/build | ||
COPY ./tex /work | ||
|
||
WORKDIR /work | ||
|
||
CMD sh ./build.sh |
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,2 +1,7 @@ | ||
# streamlined_latex_compilation | ||
Book Writing Platform: Streamlined Latex Compilation | ||
|
||
This is a sophisticated book writing platform. Whenever you push files to the main branch on GitHub, the system automatically compiles them and uploads the resulting PDF file to the release page. | ||
|
||
The resulting PDF file is named in the following format: "sample-yyyymmdd-i", where "yyyymmdd" represents the date, and "i" is a sequential number within that date. | ||
|
||
To give it a try, you can fork this project, make modifications to the included LaTeX file, and push your changes. |
Empty file.
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,8 @@ | ||
services: | ||
tex: | ||
build: . | ||
volumes: | ||
- type: bind | ||
source: ./build | ||
target: /work/build | ||
|
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,8 @@ | ||
TEXFILE=sample.tex | ||
FILE=${TEXFILE%.*} | ||
TEX=lualatex | ||
echo $FILE | ||
$TEX $TEXFILE -interaction=nonstopmode | ||
$TEX $TEXFILE -interaction=nonstopmode | ||
$TEX $TEXFILE -interaction=nonstopmode | ||
cp ${FILE}.pdf ./build |
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,8 @@ | ||
\documentclass{article} | ||
\usepackage[ipa]{luatexja-preset} | ||
\title{Sample} | ||
\author{Kimikazu Kato} | ||
\begin{document} | ||
\maketitle | ||
これはサンプルです。 | ||
\end{document} |