-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update release script [ci skip]
- Loading branch information
1 parent
cbaec5b
commit e8ee31a
Showing
2 changed files
with
66 additions
and
45 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 |
---|---|---|
@@ -1,62 +1,70 @@ | ||
#!/usr/bin/env sh | ||
|
||
export NAME=zhlipsum | ||
# This script is used for creating CTAN archive of zhlipsum. | ||
|
||
export TEX_PATH=TDS/tex/latex/$NAME | ||
export DOC_PATH=TDS/doc/latex/$NAME | ||
export SRC_PATH=TDS/source/latex/$NAME | ||
export TEMP_PATH=TDS/TEMP | ||
JOB_NAME=zhlipsum | ||
WORKING_DIR=$PWD | ||
|
||
export DOC_EN_SCRIPT=scripts/get-doc-en.lua | ||
export ZHCONVERT_SCRIPT=scripts/zhconvert.local.sh | ||
# Copy all the files to system temp folder, in order to use | ||
# chmod correctly. | ||
TEMP_DIR=/tmp/$JOB_NAME | ||
|
||
# Make TDS zip | ||
TDS_DIR=$TEMP_DIR/TDS | ||
CTAN_DIR=$TEMP_DIR/$JOB_NAME | ||
|
||
mkdir -p $SRC_PATH/ | ||
mkdir -p $TEX_PATH/ | ||
mkdir -p $DOC_PATH/ | ||
mkdir -p $TEMP_PATH/ | ||
SRC_DIR=$TDS_DIR/source/latex/$JOB_NAME | ||
TEX_DIR=$TDS_DIR/tex/latex/$JOB_NAME | ||
DOC_DIR=$TDS_DIR/doc/latex/$JOB_NAME | ||
|
||
cp source/*.dtx $TEMP_PATH/ | ||
cp source/*.pdf $TEMP_PATH/ | ||
DOC_EN_SCRIPT=$WORKING_DIR/scripts/get-doc-en.lua | ||
ZHCONVERT_SCRIPT=$WORKING_DIR/scripts/zhconvert.sh | ||
|
||
# All files should be rw-rw-r-- | ||
chmod 664 $TEMP_PATH/* | ||
mkdir -p $TEMP_DIR | ||
|
||
cd $TEMP_PATH/ | ||
xetex $NAME.dtx | ||
texlua ../../$DOC_EN_SCRIPT $NAME.dtx $NAME-en.tex | ||
source ../../$ZHCONVERT_SCRIPT | ||
cd ../.. | ||
mkdir -p $TDS_DIR | ||
mkdir -p $CTAN_DIR | ||
|
||
mv $TEMP_PATH/*.dtx $SRC_PATH/ | ||
mv $TEMP_PATH/*.ins $SRC_PATH/ | ||
mv $TEMP_PATH/*.sty $TEX_PATH/ | ||
mv $TEMP_PATH/*.def $TEX_PATH/ | ||
mv $TEMP_PATH/*.md $DOC_PATH/ | ||
mv $TEMP_PATH/*.tex $DOC_PATH/ | ||
mv $TEMP_PATH/*.pdf $DOC_PATH/ | ||
mkdir -p $SRC_DIR | ||
mkdir -p $TEX_DIR | ||
mkdir -p $DOC_DIR | ||
|
||
cd TDS/ | ||
rm -r TEMP/ | ||
cp $WORKING_DIR/source/*.dtx $TEMP_DIR | ||
cp $WORKING_DIR/source/*.pdf $TEMP_DIR | ||
|
||
zip -r -9 $NAME.tds.zip . | ||
cd .. | ||
mv -f TDS/$NAME.tds.zip . | ||
cd $TEMP_DIR | ||
xetex $JOB_NAME.dtx >/dev/null | ||
texlua $DOC_EN_SCRIPT $JOB_NAME.dtx $JOB_NAME-en.tex | ||
$ZHCONVERT_SCRIPT | ||
|
||
# Make CTAN zip | ||
# All files should be rw-r--r-- | ||
chmod 644 $TEMP_DIR/*.* | ||
|
||
mkdir CTAN/ | ||
cp $TEMP_DIR/*.dtx $SRC_DIR | ||
cp $TEMP_DIR/*.ins $SRC_DIR | ||
cp $TEMP_DIR/*.def $TEX_DIR | ||
cp $TEMP_DIR/*.sty $TEX_DIR | ||
cp $TEMP_DIR/*.md $DOC_DIR | ||
cp $TEMP_DIR/*.tex $DOC_DIR | ||
cp $TEMP_DIR/*.pdf $DOC_DIR | ||
|
||
# Make TDS zip | ||
cd $TDS_DIR | ||
zip -q -r -9 $JOB_NAME.tds.zip . | ||
|
||
cp $SRC_PATH/*.dtx CTAN/ | ||
cp $DOC_PATH/*.md CTAN/ | ||
cp $DOC_PATH/*.pdf CTAN/ | ||
cp $NAME.tds.zip CTAN/ | ||
cp $TEMP_DIR/*.dtx $CTAN_DIR | ||
cp $TEMP_DIR/*.md $CTAN_DIR | ||
cp $TEMP_DIR/*.pdf $CTAN_DIR | ||
cp $TDS_DIR/*.zip $CTAN_DIR | ||
|
||
rm -r $TDS_DIR | ||
rm $TEMP_DIR/*.* | ||
|
||
# Make CTAN zip | ||
cd $TEMP_DIR | ||
zip -q -r -9 $JOB_NAME.zip . | ||
|
||
cd CTAN/ | ||
zip -r -9 $NAME.zip . | ||
cd .. | ||
mv -f CTAN/$NAME.zip . | ||
cd $WORKING_DIR | ||
cp -f $TEMP_DIR/$JOB_NAME.zip . | ||
cp -f $CTAN_DIR/$JOB_NAME.tds.zip . | ||
|
||
rm -r TDS/ | ||
rm -r CTAN/ | ||
rm -r $TEMP_DIR |
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,13 @@ | ||
#!/usr/bin/env sh | ||
|
||
# This script is used for converting encoding from UTF-8 to GBK/Big5. | ||
|
||
JOB_NAME=zhlipsum | ||
|
||
mv $JOB_NAME-gbk.def $JOB_NAME-gbk.tmp.def | ||
mv $JOB_NAME-big5.def $JOB_NAME-big5.tmp.def | ||
|
||
iconv -f utf8 -t gbk -o $JOB_NAME-gbk.def $JOB_NAME-gbk.tmp.def | ||
iconv -f utf8 -t big5 -o $JOB_NAME-big5.def $JOB_NAME-big5.tmp.def | ||
|
||
rm *.tmp.def |