From 21dc614a1c37470bc801a5e43c3d6c8997903896 Mon Sep 17 00:00:00 2001 From: Bill Traynor Date: Thu, 6 Jun 2024 15:59:26 -0400 Subject: [PATCH] Create build-pdf.yml Signed-off-by: Bill Traynor --- .github/workflows/build-pdf.yml | 72 +++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/build-pdf.yml diff --git a/.github/workflows/build-pdf.yml b/.github/workflows/build-pdf.yml new file mode 100644 index 0000000..57cc750 --- /dev/null +++ b/.github/workflows/build-pdf.yml @@ -0,0 +1,72 @@ +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 + 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: + 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.