From 73dc6b894038cc59f7b4e8ac3c87527922be5854 Mon Sep 17 00:00:00 2001 From: Sam <30577766+Samasaur1@users.noreply.github.com> Date: Sun, 16 Feb 2020 17:03:38 -0500 Subject: [PATCH] Version 0.20.0: Multiple Documentation Versions (#73) * Swift 5.0.3, 5.1.3, remove redundancies * Update doc deployment to use new gh-pages structure (#71) * Automatically add docs to new directory; update redirect for latest version This cannot be run right now, because gh-pages has not been updated for this format. I have the changes necessary, but there's a PR already to master and I want this to have its own PR. * Get and use version * Merge changes from 'development' into docs This allows the CHANGELOG to be updated. Squashed commit of the following: commit 26f8cb773dd207d0dc2b697cf6fd398d01670ef5 Author: Sam Date: Thu Dec 26 14:13:22 2019 -0800 Swift 5.0.3, 5.1.3, remove redundancies commit b6a47f6a19395c0c94bb3ec54d42bc064bb5be0e Merge: b4f6f38 2cf658a Author: Sam <30577766+Samasaur1@users.noreply.github.com> Date: Thu Dec 26 14:54:28 2019 -0500 Version 0.19.0: No extraneous dependencies Merge pull request #70 from Samasaur1/development commit 2cf658a13a774344e8fd6d4a1974a3730dd7a70a Author: Sam <30577766+Samasaur1@users.noreply.github.com> Date: Thu Dec 26 14:16:02 2019 -0500 Update CHANGELOG date commit 3884bb674a6b47d8bb7bb2f1b9c815d8027356e0 Author: Sam <30577766+Samasaur1@users.noreply.github.com> Date: Thu Dec 26 13:52:24 2019 -0500 Finalize CHANGELOG commit 9f8a6efccabfd82d9960487fe624e7f463450331 Author: Sam Date: Wed Dec 25 11:47:11 2019 -0500 Keep track of nodanger Package.resolved and ensure files exist commit a33fc0f044505e1cd60e1bb950c84595c03f54d1 Author: Sam Date: Wed Dec 25 10:40:24 2019 -0500 Update version to 0.19.0 commit 30d9a6ff510ad5c3107fe0bfda4eb2765f50db30 Author: Sam Date: Wed Dec 25 10:39:43 2019 -0500 Update CHANGELOG commit c0ef36e59474d321affbd92d3d207f802ddb4954 Author: Sam Date: Wed Dec 25 09:59:34 2019 -0500 Overwrite package.resolved not Package.swift * Update CHANGELOG * Fix CHANGELOG (there was a merge error) * Bump version to 0.20.0 --- .deploy-docs.sh | 14 ++++++++------ .jazzy.yaml | 2 +- .travis.yml | 16 ++++++++-------- CHANGELOG.md | 5 +++++ scripts/get_version.py | 9 +++++++++ scripts/updateLatestDocs.sh | 11 +++++++++++ 6 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 scripts/get_version.py create mode 100644 scripts/updateLatestDocs.sh diff --git a/.deploy-docs.sh b/.deploy-docs.sh index 5d075d47..9adaf470 100644 --- a/.deploy-docs.sh +++ b/.deploy-docs.sh @@ -5,16 +5,18 @@ gem install jazzy rm -rf docs rm -rf DiceKit.xcodeproj swift package generate-xcodeproj -git clone --branch=gh-pages https://github.com/Samasaur1/DiceKit.git docs +git clone --branch=gh-pages https://github.com/Samasaur1/DiceKit.git ghp jazzy -o newdocs -x -target,DiceKit -rm -rf docs/* -mv newdocs/* docs/ +VERSION=$(python3 scripts/get_version.py) +mkdir ghp/docs/v$VERSION +mv newdocs/* ghp/docs/v$VERSION rm -rf newdocs/ -cd docs -echo 'section > section > p > img { margin-top: 4em; margin-right: 2em; }' >> css/jazzy.css +cd ghp +echo 'section > section > p > img { margin-top: 4em; margin-right: 2em; }' >> ghp/docs/v$VERSION/css/jazzy.css +bash ../script/updateLatestDocs.sh $VERSION git config --global user.name "Documentation Bot" git config --global user.email "docbot@travis-ci.com" git add . git commit -m "Update documentation" git remote set-url origin https://${GH_TOKEN}@github.com/Samasaur1/DiceKit.git -git push \ No newline at end of file +git push diff --git a/.jazzy.yaml b/.jazzy.yaml index 6db7d784..6a2aa44f 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -2,7 +2,7 @@ clean: true author: Samasaur author_url: https://github.com/Samasaur1 module: DiceKit -module_version: 0.19.0 +module_version: 0.20.0 # docset_icon: github_url: https://github.com/Samasaur1/DiceKit # github_file_prefix: diff --git a/.travis.yml b/.travis.yml index d52bfed1..30e34316 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,29 +17,29 @@ osx_image: xcode10 env: - SWIFT_VERSION=4.2.4 -- SWIFT_VERSION=5.0.1 +- SWIFT_VERSION=5.0.3 jobs: include: - - osx_image: xcode10.2 + - osx_image: xcode11.3 os: linux - env: SWIFT_VERSION=5.0.1 + env: SWIFT_VERSION=5.1.3 script: swift test - stage: test if: branch != master OR type = pull_request - osx_image: xcode10.2 + osx_image: xcode11.3 os: osx - env: SWIFT_VERSION=5.0.1 + env: SWIFT_VERSION=5.1.3 script: swift test - stage: deploy if: branch = master AND type = push - osx_image: xcode10.2 + osx_image: xcode11.3 os: osx - env: SWIFT_VERSION=5.0.1 + env: SWIFT_VERSION=5.1.3 script: bash .deploy-docs.sh - stage: danger os: osx - osx_image: xcode10.2 + osx_image: xcode11.3 script: swift run danger-swift ci install: - python3 scripts/include_dev_dependencies.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 954c95c2..1a3a2e0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Upcoming] +## [0.20.0] — 2020-02-16 +### Changed +- The structure of the GitHub Pages site has changed. There is now a `docs` directory, with subdirectories for each version. The auto-deployment of documentation has been update d to support this. + ## [0.19.0] - 2019-12-26 ### Added - Scripts to hide/unhide dev dependencies @@ -203,6 +207,7 @@ Update .travis.yml in case https://swiftenv.fuller.li/install.sh is down/has no - `Rollable`: a protocol for anything that is rollable [Upcoming]: https://github.com/Samasaur1/DiceKit/compare/development +[0.20.0]: https://github.com/Samasaur1/DiceKit/compare/v0.19.0...v0.20.0 [0.19.0]: https://github.com/Samasaur1/DiceKit/compare/v0.18.1...v0.19.0 [0.18.1]: https://github.com/Samasaur1/DiceKit/compare/v0.18.0...v0.18.1 [0.18.0]: https://github.com/Samasaur1/Dicekit/compare/v0.17.0...v0.18.0 diff --git a/scripts/get_version.py b/scripts/get_version.py new file mode 100644 index 00000000..4b54ff84 --- /dev/null +++ b/scripts/get_version.py @@ -0,0 +1,9 @@ +with open(".jazzy.yaml") as file: + data = file.readlines() + +for i in range(len(data)): + if data[i].startswith("module_version: "): + version = data[i][len("module_version: "):] #I know this read call includes the \n and release.py does not, but they both work and don't add or subtract a \n. ¯\_(ツ)_/¯ + index = i + +print(version, end="") \ No newline at end of file diff --git a/scripts/updateLatestDocs.sh b/scripts/updateLatestDocs.sh new file mode 100644 index 00000000..631509d2 --- /dev/null +++ b/scripts/updateLatestDocs.sh @@ -0,0 +1,11 @@ +cat > docs/latest.html < + + + + + +

The latest docs are available here.

+ + +HERE \ No newline at end of file