diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..a188672 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -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 diff --git a/.gitignore b/.gitignore index 44c1c47..666df70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.vscode/ +/.idea/ # build build diff --git a/Gemfile b/Gemfile index 7940997..f85d9d4 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/README.adoc b/README.adoc index 0620b60..0d4b1aa 100644 --- a/README.adoc +++ b/README.adoc @@ -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]. diff --git a/Rakefile b/Rakefile index 7b9ec62..99a20fc 100644 --- a/Rakefile +++ b/Rakefile @@ -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("~*") diff --git a/build-docker.sh b/build-docker.sh index fb325ad..fcc2546 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -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 "$@" diff --git a/docker-bootstrap.sh b/docker-bootstrap.sh index 0a91fe6..013e367 100644 --- a/docker-bootstrap.sh +++ b/docker-bootstrap.sh @@ -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 @@ -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} @@ -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 \ No newline at end of file +git config --global --add safe.directory /workspace diff --git a/src/main.adoc b/src/main.adoc index 07eb518..d285d19 100644 --- a/src/main.adoc +++ b/src/main.adoc @@ -2,9 +2,13 @@ The PartiQL Specification Committee :doctype: book :creator: {author} +:revnumber: v0.3.0-HEAD +:revremark: PRE-RELEASE :copyright: Copyright ©2019 Amazon.com Inc. or Affiliates (“Amazon”) :docinfo: :sectnums: +:sectanchors: +:sectlinks: :sectnumlevels: 5 :toc: :toclevels: 4