Skip to content

Commit

Permalink
Remove compiled PDF, add github workflow to generate PDF
Browse files Browse the repository at this point in the history
Signed-off-by: eop Chen <[email protected]>
  • Loading branch information
eopXD committed Aug 7, 2023
1 parent 2ddd8f9 commit 5125e28
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 3 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Create Specification Document

# The workflow is triggered by pull request, push to main, and manual dispatch.
on:
workflow_dispatch:
inputs:
version:
description: 'Release version, e.g. X.Y.Z:'
required: true
type: string
revision_mark:
description: 'Set revision mark as Draft, Release or Stable:'
required: true
type: string
default: 'Draft'
prerelease:
description: 'Tag as a pre-release?'
required: false
type: boolean
default: true
draft:
description: 'Create release as a draft?'
required: false
type: boolean
default: false
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'

# Step 2: Pull the latest RISC-V Docs container image
- name: Pull Container
run: docker pull riscvintl/riscv-docs-base-container-image:latest

# Step 3: Build Files
- name: Build Files
run: make -C doc build-container
env:
VERSION: v${{ github.event.inputs.version }}
REVMARK: ${{ github.event.inputs.revision_mark }}

# Step 4: Upload the built PDF files as a single artifact
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: Build Artifacts
path: ${{ github.workspace }}/*.pdf
retention-days: 30

# Create Release
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{ github.workspace }}/*.pdf
tag_name: v${{ github.event.inputs.version }}
name: Release ${{ github.event.inputs.version }}
draft: ${{ github.event.inputs.draft }}
prerelease: ${{ github.event.inputs.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
if: github.event_name == 'workflow_dispatch'
# This condition ensures this step only runs for workflow_dispatch events.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ legacy-api-unit-tests/non-policy-non-overloaded-api-testing/rvv-v0p10-compatible
legacy-api-unit-tests/policy-non-overloaded-api-testing/rvv-v0p10-compatible-headers
legacy-api-unit-tests/non-policy-overloaded-api-testing/rvv-v0p10-compatible-headers
legacy-api-unit-tests/policy-overloaded-api-testing/rvv-v0p10-compatible-headers
v-intrinsic-spec.pdf

14 changes: 14 additions & 0 deletions dependencies/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
source 'https://rubygems.org'
gem 'asciidoctor'
gem 'asciidoctor-bibtex'
gem 'asciidoctor-diagram'
gem 'asciidoctor-mathematical'
gem 'asciidoctor-pdf'
gem 'citeproc-ruby'
gem 'coderay'
gem 'csl-styles'
gem 'json'
gem 'pygments.rb'
gem 'rghost'
gem 'rouge'
gem 'ruby_dev'
2 changes: 2 additions & 0 deletions dependencies/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dependencies for the build environment for various package managers. Used in
`.github/workflows/`.
31 changes: 31 additions & 0 deletions dependencies/apt_packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
bison
build-essential
python3-pip
cmake
curl
flex
fonts-lyx
git
graphviz
default-jre
libcairo2-dev
libffi-dev
libgdk-pixbuf2.0-dev
libpango1.0-dev
libxml2-dev
libglib2.0-dev
make
pkg-config
ruby
ruby-dev
libgif-dev
libwebp-dev
libzstd-dev
ruby-full
gem
npm
texlive-latex-base
texlive-fonts-recommended
texlive-fonts-extra
texlive-latex-extra
texlive-science
8 changes: 8 additions & 0 deletions dependencies/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dependencies": {
"bytefield-svg": "^1.8.0",
"wavedrom-cli": "^2.6.8"
},
"name": "local",
"version": "0.0.1"
}
5 changes: 5 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ build:
$(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) --out-file=$(PDF_RESULT) $(HEADER_SOURCE)
@echo "Build completed successfully."

build-container:
@echo "Starting build inside Docker container..."
$(DOCKER_RUN) /bin/sh -c "$(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) --out-file=$(PDF_RESULT) $(HEADER_SOURCE)"
@echo "Build completed successfully inside Docker container."

clean:
@echo "Cleaning up generated files..."
rm -f $(PDF_RESULT)
Expand Down
3 changes: 0 additions & 3 deletions doc/header.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ Authors: Author 1, Author 2
:docgroup: RISC-V Vector C Intrinsic Task Group
:description: RISC-V Vector C Intrinsic Specification Document
:company: RISC-V.org
:revdate: 7/2023
:revnumber: 1.0
:revremark: This document is under development. Expect potential changes. Visit http://riscv.org/spec-state for further details.
:revinfo:
:url-riscv: http://riscv.org
:doctype: book
Expand Down
Binary file removed doc/v-intrinsic-spec.pdf
Binary file not shown.

0 comments on commit 5125e28

Please sign in to comment.