Skip to content

Add RVController marchid #3404

Add RVController marchid

Add RVController marchid #3404

Workflow file for this run

---
name: RISC-V ISA Build
on:
workflow_dispatch:
inputs:
create_release:
description: Create a new RISC-V ISA release if set to true
required: false
default: 'false'
target_branch:
description: Target Branch
required: true
default: main
release_notes:
description: Release Notes
required: false
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
# Set the short SHA for use in artifact names
- name: Set short SHA
run: echo "SHORT_SHA=$(echo ${GITHUB_SHA::7})" >> $GITHUB_ENV
# Get the current date
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
# Build PDF and HTML ISA manual versions and normative rule files using the container
- name: Build Files
id: build_files
run: make -j$(nproc)
# Upload the riscv-spec PDF file
- name: Upload riscv-spec.pdf
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: riscv-spec-${{ env.SHORT_SHA }}.pdf
path: ${{ github.workspace }}/build/riscv-spec.pdf
retention-days: 7
# Upload the riscv-spec HTML file
- name: Upload riscv-spec.html
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: riscv-spec-${{ env.SHORT_SHA }}.html
path: ${{ github.workspace }}/build/riscv-spec.html
retention-days: 7
# Upload the riscv-spec EPUB file
- name: Upload riscv-spec.epub
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: riscv-spec-${{ env.SHORT_SHA }}.epub
path: ${{ github.workspace }}/build/riscv-spec.epub
retention-days: 7
# Upload norm-rules.html
- name: Upload norm-rules.html
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: norm-rules-${{ env.SHORT_SHA }}.html
path: ${{ github.workspace }}/build/norm-rules.html
retention-days: 7
# Upload norm-rules.json
- name: Upload norm-rules.json
if: steps.build_files.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: norm-rules-${{ env.SHORT_SHA }}.json
path: ${{ github.workspace }}/build/norm-rules.json
retention-days: 7
- name: Create Release
if: steps.build_files.outcome == 'success' && github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true'
#uses: softprops/action-gh-release@v2.2.2
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
with:
draft: false
tag_name: riscv-isa-release-${{ env.SHORT_SHA }}-${{ env.CURRENT_DATE }}
name: ${{ env.CURRENT_DATE }}
body: |
This release was created by: ${{ github.event.sender.login }}
Release Notes: ${{ github.event.inputs.release_notes }}
files: |
${{ github.workspace }}/build/riscv-spec.pdf
${{ github.workspace }}/build/riscv-spec.html
${{ github.workspace }}/build/riscv-spec.epub
${{ github.workspace }}/build/norm-rules.html
${{ github.workspace }}/build/norm-rules.json
env:
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
# Create directory structure pages sites for ISA manual and normative rule files.
# Copy priv/unpriv ISA manual HTML also into norm-rules directory so hyperlinks from
# norm-rules.html into the ISA manual are found (matches local build).
- name: Make GitHub pages directory
run: |
mkdir -p dist/snapshot/spec dist/snapshot/norm-rules
cp build/riscv-spec.html dist/snapshot/spec/index.html
cp build/norm-rules.html dist/snapshot/norm-rules/index.html
cp build/norm-rules.html dist/snapshot/norm-rules/norm-rules.html
cp build/norm-rules.json dist/snapshot/norm-rules/norm-rules.json
cp build/riscv-spec.html dist/snapshot/norm-rules/riscv-spec.html
# Add root redirect
printf '<!DOCTYPE html>\n<html>\n<head>\n <meta charset="utf-8">\n <meta http-equiv="refresh" content="0; url=snapshot/spec/">\n <link rel="canonical" href="snapshot/spec/">\n <title>RISC-V ISA Manual</title>\n</head>\n<body>\n <p>Redirecting to <a href="snapshot/spec/">RISC-V ISA Manual</a>…</p>\n</body>\n</html>\n' > dist/index.html
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: dist
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
# Deploy HTML to GitHub pages.
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5