Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds GH pages workflow and minor updates #48

Merged
merged 16 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
##
# Publish HTML to GH Pages
# - Runs the build script.
# - Moves relevant artifacts to publishing directory
# - Moves publishing directory contents to GH pages.
##

name: Publish to GH Pages

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: ls
- name: Build using Docker
run: /bin/bash ./build-docker.sh
- name: Move to Publish Directory
run: |
mkdir ./publish
mv ./build/PartiQL-Specification.html ./publish/index.html
mv ./build/images ./publish/
- name: Deploy to GH Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./publish
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.vscode/
/.idea/

# build
build
Expand Down
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ source 'https://rubygems.org'

gem 'rake'

gem 'asciidoctor'
gem 'asciidoctor-pdf'
gem 'asciidoctor-mathematical'
gem 'asciidoctor', '2.0.20'
gem 'asciidoctor-pdf', '2.3.9'
gem 'mathematical', '1.6.14'
gem 'asciidoctor-mathematical', '0.3.5'

gem 'prawn'
gem 'prawn-table', github: 'prawnpdf/prawn-table'
gem 'prawn-svg'
Expand Down
5 changes: 3 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ To build `HTML` and optimized `PDF`
bundle exec rake
```

=== Releasing

To perform a release, update `revnumber` and remove `revremark` in `src/main.adoc` in a single commit. Once updated, tag the commit. Then, update the `revnumber` and re-add `revremark` accordingly.


= License
== License

This library is licensed under the link:LICENSE[PartiQL Specification License].
10 changes: 5 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version_string = `git describe --tag | cut -d "-" -f 1,2 | tr - .`.chomp
if version_string.empty?
version_string = '0'
# Attempt to grab the date of the latest commit. If unable to, fail.
date_string = `git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d'`.chomp
if date_string.empty?
raise "Failed to get the date from the latest commit. Do you have access to the Git log?"
end
date_string = Time.now.strftime("%Y-%m-%d")
params = "--attribute revnumber='#{version_string}' --attribute revdate='#{date_string}'"
params = "--attribute revdate='#{date_string}'"

image_files = Rake::FileList.new("src/images/*.png", "src/images/*.svg") do |fl|
fl.exclude("~*")
Expand Down
2 changes: 1 addition & 1 deletion build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ run_check docker build ${DOCKER_ARGS} -t ${IMAGE_TAG} \
--build-arg GROUP_ID=$(id -g) \
$(pwd)

run_check docker run ${DOCKER_ARGS} -it --rm \
run_check docker run ${DOCKER_ARGS} --rm \
--mount type=bind,source="$(pwd)",target=/workspace \
${IMAGE_TAG} /bin/bash --login docker-run.sh "$@"
7 changes: 4 additions & 3 deletions docker-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -e

BOOTSTRAP_DIR=${HOME}/bootstrap
RUBY_VERSION="3.2.2"

# Install rbenv
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
Expand All @@ -12,8 +13,8 @@ echo 'eval "$(~/.rbenv/bin/rbenv init - zsh)"' >> ~/.zshrc
eval "$(~/.rbenv/bin/rbenv init - bash)"

# Install latest stable Ruby
rbenv install $(rbenv install -l | grep -v - | tail -1)
rbenv global $(rbenv install -l | grep -v - | tail -1)
rbenv install ${RUBY_VERSION}
rbenv global ${RUBY_VERSION}

# Install our required Gems
cd ${BOOTSTRAP_DIR}
Expand All @@ -27,4 +28,4 @@ curl -L -o fonts/iosevka.zip https://github.com/be5invis/Iosevka/releases/downlo
unzip fonts/iosevka.zip -d fonts/iosevka

# Rake doesn't like the ownership of our workspace in the container
git config --global --add safe.directory /workspace
git config --global --add safe.directory /workspace
5 changes: 5 additions & 0 deletions src/main.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
The PartiQL Specification Committee
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it too involved to add a link to the latest released version (as adoc) at the top? if yes, maybe we can add a link to the list of all releases?

https://github.com/partiql/partiql-lang/releases

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, and thank you for porting the previous releases!

:doctype: book
:creator: {author}
:revnumber: v0.3.0-HEAD
:version-label!:
:revremark: PRE-RELEASE. See official releases at https://github.com/partiql/partiql-lang/releases
:copyright: Copyright ©2019 Amazon.com Inc. or Affiliates (“Amazon”)
:docinfo:
:sectnums:
:sectanchors:
:sectlinks:
:sectnumlevels: 5
:toc:
:toclevels: 4
Expand Down