Skip to content

Commit

Permalink
Version 0.20.0: Multiple Documentation Versions (#73)
Browse files Browse the repository at this point in the history
* 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 26f8cb7
Author: Sam <[email protected]>
Date:   Thu Dec 26 14:13:22 2019 -0800

    Swift 5.0.3, 5.1.3, remove redundancies

commit b6a47f6
Merge: b4f6f38 2cf658a
Author: Sam <[email protected]>
Date:   Thu Dec 26 14:54:28 2019 -0500

    Version 0.19.0: No extraneous dependencies

    Merge pull request #70 from Samasaur1/development

commit 2cf658a
Author: Sam <[email protected]>
Date:   Thu Dec 26 14:16:02 2019 -0500

    Update CHANGELOG date

commit 3884bb6
Author: Sam <[email protected]>
Date:   Thu Dec 26 13:52:24 2019 -0500

    Finalize CHANGELOG

commit 9f8a6ef
Author: Sam <[email protected]>
Date:   Wed Dec 25 11:47:11 2019 -0500

    Keep track of nodanger Package.resolved and ensure files exist

commit a33fc0f
Author: Sam <[email protected]>
Date:   Wed Dec 25 10:40:24 2019 -0500

    Update version to 0.19.0

commit 30d9a6f
Author: Sam <[email protected]>
Date:   Wed Dec 25 10:39:43 2019 -0500

    Update CHANGELOG

commit c0ef36e
Author: Sam <[email protected]>
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
  • Loading branch information
Samasaur1 authored Feb 16, 2020
1 parent b6a47f6 commit 73dc6b8
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 15 deletions.
14 changes: 8 additions & 6 deletions .deploy-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
git add .
git commit -m "Update documentation"
git remote set-url origin https://${GH_TOKEN}@github.com/Samasaur1/DiceKit.git
git push
git push
2 changes: 1 addition & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions scripts/get_version.py
Original file line number Diff line number Diff line change
@@ -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="")
11 changes: 11 additions & 0 deletions scripts/updateLatestDocs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cat > docs/latest.html <<HERE
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Refresh" content="0; url=v$1/index.html" />
</head>
<body>
<p>The latest docs are available <a href="v$1/index.html">here</a>.</p>
</body>
</html>
HERE

0 comments on commit 73dc6b8

Please sign in to comment.