-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rafael Sene <rafael@riscv.org>
- Loading branch information
Showing
28 changed files
with
599 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
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, for instance, 0.1:' | ||
required: true | ||
type: string | ||
revision_mark: | ||
description: 'Set revision mark as Draft, Stable, Frozen or Ratified:' | ||
required: true | ||
type: choice | ||
options: | ||
- Draft | ||
- Stable | ||
- Frozen | ||
- Ratified | ||
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: | ||
# Checkout the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
# Pull the latest RISC-V Docs container image | ||
- name: Pull Container | ||
run: docker pull riscvintl/riscv-docs-base-container-image:latest | ||
|
||
# Override VERSION and REVMARK for manual workflow dispatch | ||
- name: Update environment variables | ||
run: | | ||
echo "VERSION=v${{ github.event.inputs.version }}" >> "$GITHUB_ENV" | ||
echo "REVMARK=${{ github.event.inputs.revision_mark }}" >> "$GITHUB_ENV" | ||
if: github.event_name == 'workflow_dispatch' | ||
|
||
# Build Files | ||
- name: Build Files | ||
run: make | ||
|
||
# Upload the built PDF files as a single artifact | ||
- name: Upload Build Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Build Artifacts | ||
path: ${{ github.workspace }}/build/*.pdf | ||
retention-days: 30 | ||
|
||
# Create Release | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: ${{ github.workspace }}/build/*.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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- uses: pre-commit/action@v3.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build/* | ||
/images/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "docs-resources"] | ||
path = docs-resources | ||
url = https://github.com/riscv/docs-resources.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-json | ||
- id: check-symlinks | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] | ||
|
||
- repo: local | ||
hooks: | ||
- id: forbidden-file-extensions | ||
name: forbidden-file-extensions | ||
entry: disallow these file extensions | ||
language: fail | ||
# Disallow other asciidoc extensions except .adoc | ||
files: .*\.(asciidoc|asc)$ | ||
|
||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
rev: 0.2.3 | ||
hooks: | ||
- id: yamlfmt | ||
args: [--mapping, '2', --sequence, '4', --offset, '2'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
**_NOTE:_** PROJECTS BUILT USING THE TEMPLATE SHOULD UPDATE THE BELOW SECTIONS AS-NEEDED. | ||
|
||
## [Unreleased] | ||
|
||
## [4.0.0] - 2004-01-27 | ||
- Workflow improvements | ||
- Makefile refactoring | ||
- Readme updates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# RISC-V Code of Conduct | ||
All RISC-V International projects are governed by the RISC-V Code of Conduct found at https://riscv.org/community/community-code-of-conduct/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Governance | ||
This project for the template specification is governed by the Documentation SIG. | ||
|
||
The group can be joined by RISC-V members at: https://lists.riscv.org/g/sig-documentation. | ||
|
||
Mailing list archives are available at: https://lists.riscv.org/g/sig-documentation/topics. | ||
|
||
**_NOTE:_** PROJECTS BUILT USING THE TEMPLATE SHOULD UPDATE THE ABOVE TEXT AS-NEEDED. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Maintainers | ||
This project is maintained by the following people: | ||
|
||
- Bill Traynor ([wmat](https://github.com/wmat)) | ||
|
||
**_NOTE:_** PROJECTS BUILT USING THE TEMPLATE SHOULD UPDATE THE ABOVE TEXT AS-NEEDED. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Makefile for RISC-V Doc Template | ||
# | ||
# This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 | ||
# International License. To view a copy of this license, visit | ||
# http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to | ||
# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. | ||
# | ||
# SPDX-License-Identifier: CC-BY-SA-4.0 | ||
# | ||
# Description: | ||
# | ||
# This Makefile is designed to automate the process of building and packaging | ||
# the Doc Template for RISC-V Extensions. | ||
|
||
DOCS := \ | ||
clic.adoc | ||
|
||
DATE ?= $(shell date +%Y-%m-%d) | ||
VERSION ?= v0.9 | ||
REVMARK ?= Draft | ||
DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest | ||
ifneq ($(SKIP_DOCKER),true) | ||
DOCKER_CMD := docker run --rm -v ${PWD}:/build -w /build \ | ||
${DOCKER_IMG} \ | ||
/bin/sh -c | ||
DOCKER_QUOTE := " | ||
endif | ||
|
||
SRC_DIR := src | ||
BUILD_DIR := build | ||
|
||
DOCS_PDF := $(DOCS:%.adoc=%.pdf) | ||
DOCS_HTML := $(DOCS:%.adoc=%.html) | ||
|
||
XTRA_ADOC_OPTS := | ||
ASCIIDOCTOR_PDF := asciidoctor-pdf | ||
ASCIIDOCTOR_HTML := asciidoctor | ||
OPTIONS := --trace \ | ||
-a compress \ | ||
-a mathematical-format=svg \ | ||
-a revnumber=${VERSION} \ | ||
-a revremark=${REVMARK} \ | ||
-a revdate=${DATE} \ | ||
-a pdf-fontsdir=docs-resources/fonts \ | ||
-a pdf-theme=docs-resources/themes/riscv-pdf.yml \ | ||
$(XTRA_ADOC_OPTS) \ | ||
-D build \ | ||
--failure-level=ERROR | ||
REQUIRES := --require=asciidoctor-bibtex \ | ||
--require=asciidoctor-diagram \ | ||
--require=asciidoctor-lists \ | ||
--require=asciidoctor-mathematical | ||
|
||
.PHONY: all build clean build-container build-no-container build-docs | ||
|
||
all: build | ||
|
||
build-docs: $(DOCS_PDF) $(DOCS_HTML) | ||
|
||
vpath %.adoc $(SRC_DIR) | ||
|
||
%.pdf: %.adoc | ||
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE) | ||
|
||
%.html: %.adoc | ||
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_HTML) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE) | ||
|
||
build: | ||
@echo "Checking if Docker is available..." | ||
@if command -v docker >/dev/null 2>&1 ; then \ | ||
echo "Docker is available, building inside Docker container..."; \ | ||
$(MAKE) build-container; \ | ||
else \ | ||
echo "Docker is not available, building without Docker..."; \ | ||
$(MAKE) build-no-container; \ | ||
fi | ||
|
||
build-container: | ||
@echo "Starting build inside Docker container..." | ||
$(MAKE) build-docs | ||
@echo "Build completed successfully inside Docker container." | ||
|
||
build-no-container: | ||
@echo "Starting build..." | ||
$(MAKE) SKIP_DOCKER=true build-docs | ||
@echo "Build completed successfully." | ||
|
||
# Update docker image to latest | ||
docker-pull-latest: | ||
docker pull ${DOCKER_IMG} | ||
|
||
clean: | ||
@echo "Cleaning up generated files..." | ||
rm -rf $(BUILD_DIR) | ||
@echo "Cleanup completed." |
Oops, something went wrong.