Skip to content

Commit

Permalink
Merge pull request #48 from johnedquinn/gh-pages-setup
Browse files Browse the repository at this point in the history
Adds GH pages workflow and minor updates
  • Loading branch information
johnedquinn authored Dec 5, 2023
2 parents 66a5086 + 0c17299 commit e1e00cb
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 14 deletions.
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
: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

0 comments on commit e1e00cb

Please sign in to comment.