Skip to content

Commit

Permalink
docs: Add the release notes to the website
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmorley committed Jan 18, 2024
1 parent 2b5d818 commit 6b96312
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ jobs:
run: |
scripts/build.sh
- name: Build website
run: |
scripts/build-website.sh
chmod -v -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2

- name: Archive the binary
uses: actions/upload-artifact@v3
with:
Expand Down
14 changes: 8 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
build
docs/_site
docs/.jekyll-cache
fastlane/.env
fastlane/report.xml
.local
.tool-versions
.tool-versions

/_site
/build
/docs/.jekyll-cache
/docs/_site
/docs/release-notes
/macos/build
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ github_username: jekyll
theme: minima
plugins:
- jekyll-feed
destination: ../_site

defaults:
- values:
Expand Down
1 change: 1 addition & 0 deletions docs/_includes/navigation.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<ul class="navigation">
<li><a href="/">Overview</a></li>
<li><a href="/release-notes">Release Notes</a></li>
<li><a href="/privacy-policy">Privacy Policy</a></li>
<li><a href="https://github.com/inseven/overview" target="_blank">GitHub</a></li>
</ul>
58 changes: 58 additions & 0 deletions scripts/build-website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

# Copyright (c) 2018-2023 Jason Morley, Tom Sutcliffe
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

set -e
set -o pipefail
set -x
set -u

SCRIPTS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

ROOT_DIRECTORY="${SCRIPTS_DIRECTORY}/.."
WEBSITE_DIRECTORY="${ROOT_DIRECTORY}/docs"
WEBSITE_SIMULATOR_DIRECTORY="${ROOT_DIRECTORY}/docs/simulator"
SIMULATOR_WEB_DIRECTORY="${ROOT_DIRECTORY}/simulator/web"

RELEASE_NOTES_TEMPLATE_PATH="${SCRIPTS_DIRECTORY}/release-notes.markdown"
RELEASE_NOTES_DIRECTORY="${ROOT_DIRECTORY}/docs/release-notes"
RELEASE_NOTES_PATH="${RELEASE_NOTES_DIRECTORY}/index.markdown"

source "${SCRIPTS_DIRECTORY}/environment.sh"

cd "$ROOT_DIRECTORY"
if [ -d "${RELEASE_NOTES_DIRECTORY}" ]; then
rm -r "${RELEASE_NOTES_DIRECTORY}"
fi
mkdir -p "${RELEASE_NOTES_DIRECTORY}"
changes notes --pre-release --all --released --template "$RELEASE_NOTES_TEMPLATE_PATH" > "$RELEASE_NOTES_PATH"

# Install the Jekyll dependencies.
export GEM_HOME="${ROOT_DIRECTORY}/.local/ruby"
mkdir -p "$GEM_HOME"
export PATH="${GEM_HOME}/bin":$PATH
gem install bundler
cd "${WEBSITE_DIRECTORY}"
bundle install

# Build the website.
cd "${WEBSITE_DIRECTORY}"
bundle exec jekyll build
15 changes: 15 additions & 0 deletions scripts/release-notes.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Release Notes
---

# Release Notes

{% for release in releases -%}
## {{ release.version }}{% if not release.is_released %} (Unreleased){% endif %}
{% for section in release.sections %}
**{{ section.title }}**

{% for change in section.changes | reverse -%}
- {{ change.description }}{% if change.scope %}{{ change.scope }}{% endif %}
{% endfor %}{% endfor %}
{% endfor %}
41 changes: 41 additions & 0 deletions scripts/update-release-notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# Copyright (c) 2021-2023 Jason Morley, Tom Sutcliffe
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

set -e
set -o pipefail
set -x
set -u

SCRIPTS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

ROOT_DIRECTORY="${SCRIPTS_DIRECTORY}/.."
RELEASE_NOTES_TEMPLATE_PATH="${SCRIPTS_DIRECTORY}/release-notes.markdown"
RELEASE_NOTES_DIRECTORY="${ROOT_DIRECTORY}/docs/release-notes"
RELEASE_NOTES_PATH="${RELEASE_NOTES_DIRECTORY}/index.markdown"

source "${SCRIPTS_DIRECTORY}/environment.sh"


cd "$ROOT_DIRECTORY"

mkdir -p "$RELEASE_NOTES_DIRECTORY"
changes notes --all --released --template "$RELEASE_NOTES_TEMPLATE_PATH" > "$RELEASE_NOTES_PATH"

0 comments on commit 6b96312

Please # to comment.