mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-08 23:20:03 +00:00
Add multiwikidocs edition and CI to build it
This commit is contained in:
parent
8ac2730eb1
commit
386af03f6d
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@ -4,6 +4,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- tiddlywiki-com
|
- tiddlywiki-com
|
||||||
|
- multi-wiki-support
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: "22"
|
NODE_VERSION: "22"
|
||||||
jobs:
|
jobs:
|
||||||
@ -82,3 +83,15 @@ jobs:
|
|||||||
- run: "./bin/build-tw-org.sh"
|
- run: "./bin/build-tw-org.sh"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUBPUSHTOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUBPUSHTOKEN }}
|
||||||
|
build-mws-tiddlywiki-com:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref == 'refs/heads/multi-wiki-support'
|
||||||
|
needs: test
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE_VERSION }}"
|
||||||
|
- run: "./bin/build-mws-site.sh"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUBPUSHTOKEN }}
|
||||||
|
97
bin/build-mws-site.sh
Executable file
97
bin/build-mws-site.sh
Executable file
@ -0,0 +1,97 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Build mws.tiddlywiki.com assets.
|
||||||
|
|
||||||
|
# Default to the version of TiddlyWiki installed in this repo
|
||||||
|
|
||||||
|
if [ -z "$MWSTWCOM_BUILD_TIDDLYWIKI" ]; then
|
||||||
|
MWSTWCOM_BUILD_TIDDLYWIKI=./tiddlywiki.js
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Using MWSTWCOM_BUILD_TIDDLYWIKI as [$MWSTWCOM_BUILD_TIDDLYWIKI]"
|
||||||
|
|
||||||
|
# Set up the build details
|
||||||
|
|
||||||
|
if [ -z "$MWSTWCOM_BUILD_DETAILS" ]; then
|
||||||
|
MWSTWCOM_BUILD_DETAILS="$(git symbolic-ref --short HEAD)-$(git rev-parse HEAD) from $(git remote get-url origin)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Using MWSTWCOM_BUILD_DETAILS as [$MWSTWCOM_BUILD_DETAILS]"
|
||||||
|
|
||||||
|
if [ -z "$MWSTWCOM_BUILD_COMMIT" ]; then
|
||||||
|
MWSTWCOM_BUILD_COMMIT="$(git rev-parse HEAD)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Using MWSTWCOM_BUILD_COMMIT as [$MWSTWCOM_BUILD_COMMIT]"
|
||||||
|
|
||||||
|
# Set up the build output directory
|
||||||
|
|
||||||
|
if [ -z "$MWSTWCOM_BUILD_OUTPUT" ]; then
|
||||||
|
MWSTWCOM_BUILD_OUTPUT=$(mktemp -d)
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p $MWSTWCOM_BUILD_OUTPUT
|
||||||
|
|
||||||
|
if [ ! -d "$MWSTWCOM_BUILD_OUTPUT" ]; then
|
||||||
|
echo 'A valid MWSTWCOM_BUILD_OUTPUT environment variable must be set'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Using MWSTWCOM_BUILD_OUTPUT as [$MWSTWCOM_BUILD_OUTPUT]"
|
||||||
|
|
||||||
|
# Pull existing GitHub pages content
|
||||||
|
|
||||||
|
git clone --depth=1 --branch=main "https://github.com/TiddlyWiki/mws.tiddlywiki.com-gh-pages.git" $MWSTWCOM_BUILD_OUTPUT
|
||||||
|
|
||||||
|
# Make the CNAME file that GitHub Pages requires
|
||||||
|
|
||||||
|
echo "mws.tiddlywiki.com" > $MWSTWCOM_BUILD_OUTPUT/CNAME
|
||||||
|
|
||||||
|
# Delete any existing static content
|
||||||
|
|
||||||
|
mkdir -p $MWSTWCOM_BUILD_OUTPUT/static
|
||||||
|
rm $MWSTWCOM_BUILD_OUTPUT/static/*
|
||||||
|
|
||||||
|
# Put the build details into a .tid file so that it can be included in each build (deleted at the end of this script)
|
||||||
|
|
||||||
|
echo -e -n "title: $:/build\ncommit: $MWSTWCOM_BUILD_COMMIT\n\n$MWSTWCOM_BUILD_DETAILS\n" > $MWSTWCOM_BUILD_OUTPUT/build.tid
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
#
|
||||||
|
# mws.tiddlywiki.com distribution
|
||||||
|
#
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
# /index.html Main site
|
||||||
|
# /favicon.ico Favicon for main site
|
||||||
|
# /static.html Static rendering of default tiddlers
|
||||||
|
# /alltiddlers.html Static rendering of all tiddlers
|
||||||
|
# /static/* Static single tiddlers
|
||||||
|
# /static/static.css Static stylesheet
|
||||||
|
# /static/favicon.ico Favicon for static pages
|
||||||
|
node $MWSTWCOM_BUILD_TIDDLYWIKI \
|
||||||
|
editions/multiwikidocs \
|
||||||
|
--verbose \
|
||||||
|
--version \
|
||||||
|
--load $MWSTWCOM_BUILD_OUTPUT/build.tid \
|
||||||
|
--output $MWSTWCOM_BUILD_OUTPUT \
|
||||||
|
--build favicon static index \
|
||||||
|
|| exit 1
|
||||||
|
|
||||||
|
# Delete the temporary build tiddler
|
||||||
|
|
||||||
|
rm $MWSTWCOM_BUILD_OUTPUT/build.tid || exit 1
|
||||||
|
|
||||||
|
# Push output back to GitHub
|
||||||
|
|
||||||
|
# Exit script immediately if any command fails
|
||||||
|
set -e
|
||||||
|
|
||||||
|
pushd $MWSTWCOM_BUILD_OUTPUT
|
||||||
|
git config --global user.email "actions@github.com"
|
||||||
|
git config --global user.name "GitHub Actions"
|
||||||
|
git add -A .
|
||||||
|
git commit --message "GitHub build: $GITHUB_RUN_NUMBER of $TW5_BUILD_BRANCH ($(date +'%F %T %Z'))"
|
||||||
|
git remote add deploy "https://$GH_TOKEN@github.com/TiddlyWiki/mws.tiddlywiki.com-gh-pages.git" &>/dev/null
|
||||||
|
git push deploy main &>/dev/null
|
||||||
|
popd
|
3
editions/multiwikidocs/tiddlers/DefaultTiddlers.tid
Normal file
3
editions/multiwikidocs/tiddlers/DefaultTiddlers.tid
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
title: $:/DefaultTiddlers
|
||||||
|
|
||||||
|
HelloThere
|
3
editions/multiwikidocs/tiddlers/HelloThere.tid
Normal file
3
editions/multiwikidocs/tiddlers/HelloThere.tid
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
title: HelloThere
|
||||||
|
|
||||||
|
Hello! This is a test
|
23
editions/multiwikidocs/tiddlywiki.info
Normal file
23
editions/multiwikidocs/tiddlywiki.info
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"description": "Multiple wiki server documentation edition",
|
||||||
|
"plugins": [
|
||||||
|
],
|
||||||
|
"themes": [
|
||||||
|
"tiddlywiki/vanilla",
|
||||||
|
"tiddlywiki/snowwhite"
|
||||||
|
],
|
||||||
|
"build": {
|
||||||
|
"index": [
|
||||||
|
"--savetiddlers","[tag[external-image]]","images",
|
||||||
|
"--setfield","[tag[external-image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
|
||||||
|
"--setfield","[tag[external-image]]","text","","text/plain",
|
||||||
|
"--render","$:/core/save/all","index.html","text/plain"],
|
||||||
|
"favicon": [
|
||||||
|
"--savetiddler","$:/favicon.ico","favicon.ico"],
|
||||||
|
"static": [
|
||||||
|
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||||
|
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||||
|
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||||
|
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user