From 8a690c222b2c7984ffce8990584167876427cc21 Mon Sep 17 00:00:00 2001 From: Franco Meloni Date: Sat, 22 Feb 2020 19:07:34 +0000 Subject: [PATCH 1/5] Create script to update docs website on relase --- scripts/update_docs_website.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/update_docs_website.sh diff --git a/scripts/update_docs_website.sh b/scripts/update_docs_website.sh new file mode 100755 index 000000000..c2f281786 --- /dev/null +++ b/scripts/update_docs_website.sh @@ -0,0 +1,15 @@ +git clone git@github.com:Moya/moya.github.io.git _moya.github.io + +jazzy -o _moya.github.io + +cd _moya.github.io + +git add . + +git commit -m "Update docs for version $VERSION" + +git push origin HEAD + +cd .. + +rm -rf _moya.github.io From 22d3568717926b4f6824ba68b050c8683e2ad9b6 Mon Sep 17 00:00:00 2001 From: Franco Meloni Date: Sat, 22 Feb 2020 19:08:32 +0000 Subject: [PATCH 2/5] Run update_docs_website during releases --- Package.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 386097c98..3908ec522 100644 --- a/Package.swift +++ b/Package.swift @@ -42,7 +42,8 @@ let config = PackageConfiguration([ "scripts/update_podspec.sh" ], "after": [ - "rake create_release\\[\"$VERSION\"\\]" + "rake create_release\\[\"$VERSION\"\\]", + "scripts/update_docs_website.sh" ] ] ]).write() From bbb1109e21e40e8aac5ad55fd68d06bf944b6934 Mon Sep 17 00:00:00 2001 From: Franco Meloni Date: Sat, 22 Feb 2020 19:16:00 +0000 Subject: [PATCH 3/5] Update Releasing.md --- docs/Releasing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Releasing.md b/docs/Releasing.md index 3536bd8da..4854e8214 100644 --- a/docs/Releasing.md +++ b/docs/Releasing.md @@ -25,6 +25,7 @@ If you see an error command that you do not have registered session, run command ```ruby pod trunk register you@youremailaddress.com ``` +1. Install jazzy `[sudo] gem install jazzy` ## Release @@ -45,6 +46,5 @@ What you might need to do manually afterwards: 1. Update the instructions for our supported package managers in the Readme to use the release you just made public (e.g. update version numbers if it was a major release). 1. Update Swift/Moya version table if needed. 1. Update the release description in [GitHub releases tab](https://github.com/Moya/Moya/releases/tag). -1. Check if we need to regenerate docs for [moya.github.io](https://github.com/Moya/moya.github.io). If anything goes wrong, don't panic! Get in touch with someone else who has released, or [Ash](mailto:ash@ashfurrow.com). From 71b8c3998155beb3ce98da5c21ca9dd66fd02ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mro=CC=81z?= Date: Mon, 24 Feb 2020 12:34:01 +0100 Subject: [PATCH 4/5] Consistently produce jazzy docs It was failing most of the time otherwise... --- scripts/update_docs_website.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/update_docs_website.sh b/scripts/update_docs_website.sh index c2f281786..0ab3982a8 100755 --- a/scripts/update_docs_website.sh +++ b/scripts/update_docs_website.sh @@ -1,6 +1,10 @@ git clone git@github.com:Moya/moya.github.io.git _moya.github.io -jazzy -o _moya.github.io +# These two lines, instead of pure `jazzy -o ...` make sure we consistently produce docs +# Otherwise we would sometimes get empty docs due to some cache bug & new Xcode file response +# Relevant: https://github.com/realm/jazzy/issues/1087 +rm -rf ~/Library/Developer/Xcode/DerivedData/Moya* +jazzy -x USE_SWIFT_RESPONSE_FILE=NO -o _moya.github.io cd _moya.github.io From 0caa6310e25aa9fdbb4c91d7a36f8a62ccaf6328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mro=CC=81z?= Date: Mon, 24 Feb 2020 12:34:23 +0100 Subject: [PATCH 5/5] Add "docs/" folder (Guides) to the the generated moya website --- scripts/update_docs_website.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update_docs_website.sh b/scripts/update_docs_website.sh index 0ab3982a8..03804097e 100755 --- a/scripts/update_docs_website.sh +++ b/scripts/update_docs_website.sh @@ -4,7 +4,7 @@ git clone git@github.com:Moya/moya.github.io.git _moya.github.io # Otherwise we would sometimes get empty docs due to some cache bug & new Xcode file response # Relevant: https://github.com/realm/jazzy/issues/1087 rm -rf ~/Library/Developer/Xcode/DerivedData/Moya* -jazzy -x USE_SWIFT_RESPONSE_FILE=NO -o _moya.github.io +jazzy --documentation=docs/*.md -x USE_SWIFT_RESPONSE_FILE=NO -o _moya.github.io cd _moya.github.io