diff options
author | Rafael Sene <rafael@riscv.org> | 2023-04-27 11:42:05 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 11:42:05 -0300 |
commit | 24480bf7fef3dc19faf20623ed11f92d9fe4f07a (patch) | |
tree | 2f269f6ccd0f3c88b0e5dec08eefbbb6bd91872a /.github | |
parent | 83f999773417223b9f6526ad000d6a29eb70e34e (diff) | |
download | riscv-isa-manual-24480bf7fef3dc19faf20623ed11f92d9fe4f07a.zip riscv-isa-manual-24480bf7fef3dc19faf20623ed11f92d9fe4f07a.tar.gz riscv-isa-manual-24480bf7fef3dc19faf20623ed11f92d9fe4f07a.tar.bz2 |
Update the build process
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build-pdf.yml | 75 | ||||
-rw-r--r-- | .github/workflows/build-priv-pdf.yml | 75 | ||||
-rw-r--r-- | .github/workflows/build-unpriv-pdf.yml | 75 | ||||
-rw-r--r-- | .github/workflows/create-release.yml | 43 | ||||
-rw-r--r-- | .github/workflows/isa-build.yml (renamed from .github/workflows/build-pdf-and-html.yml) | 51 |
5 files changed, 38 insertions, 281 deletions
diff --git a/.github/workflows/build-pdf.yml b/.github/workflows/build-pdf.yml deleted file mode 100644 index 1da7650..0000000 --- a/.github/workflows/build-pdf.yml +++ /dev/null @@ -1,75 +0,0 @@ -# This workflow installs dependencies for PDF generation, generates the PDF, -# and uploads the PDF as an artifact. - -name: Build Document PDF - -on: - workflow_dispatch: - workflow_call: - outputs: - name: - description: "The base name of the pdf file (without .pdf extensions)" - value: ${{ jobs.build.outputs.name }} - pdf-name: - description: "The name of the pdf file (with .pdf extensions)" - value: ${{ jobs.build.outputs.pdf-name }} - -jobs: - build: - runs-on: ubuntu-latest - - env: - NAME: unpriv-isa-asciidoc - APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt - BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile - BUNDLE_BIN: ${{ github.workspace }}/bin - NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies - outputs: - name: ${{ steps.step1.outputs.name }} - pdf-name: ${{ steps.step2.outputs.pdf-name }} - if: contains(github.ref, 'riscv-isa-asciidoc') - steps: - - name: Set outputs.name - id: step1 - run: echo "name=$NAME" >> $GITHUB_OUTPUT - - name: Set outputs.pdf-name - id: step2 - run: echo "pdf-name=$NAME.pdf" >> $GITHUB_OUTPUT - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Install Ubuntu packages - run: | - sudo apt-get update - grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends - # Ruby for asciidoctor - - name: Setup Ruby and Gemfile content - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2.0" - bundler-cache: true - # Node.js for wavedrom - - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - - name: Install Node.js dependencies - run: npm install ${NPM_PACKAGE_FOLDER} - - name: Generate PDF - working-directory: ./build - run: | - PATH=${PATH}:${BUNDLE_BIN}:$(npm bin) \ - make - - name: Archive PDF result - uses: actions/upload-artifact@v3 - with: - name: ${{ env.NAME }}.pdf - path: ./build/${{ env.NAME }}.pdf - retention-days: 7 diff --git a/.github/workflows/build-priv-pdf.yml b/.github/workflows/build-priv-pdf.yml deleted file mode 100644 index 4c972fc..0000000 --- a/.github/workflows/build-priv-pdf.yml +++ /dev/null @@ -1,75 +0,0 @@ -# This workflow installs dependencies for PDF generation, generates the PDF, -# and uploads the PDF as an artifact. - -name: Build Priv PDF - -on: - workflow_dispatch: - workflow_call: - outputs: - name: - description: "The base name of the pdf file (without .pdf extensions)" - value: ${{ jobs.build.outputs.name }} - pdf-name: - description: "The name of the pdf file (with .pdf extensions)" - value: ${{ jobs.build.outputs.pdf-name }} - -jobs: - build: - runs-on: ubuntu-latest - - env: - NAME: priv-isa-asciidoc - APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt - BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile - BUNDLE_BIN: ${{ github.workspace }}/bin - NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies - outputs: - name: ${{ steps.step1.outputs.name }} - pdf-name: ${{ steps.step2.outputs.pdf-name }} - if: contains(github.ref, 'riscv-isa-asciidoc') - steps: - - name: Set outputs.name - id: step1 - run: echo "name=$NAME" >> $GITHUB_OUTPUT - - name: Set outputs.pdf-name - id: step2 - run: echo "pdf-name=$NAME.pdf" >> $GITHUB_OUTPUT - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Install Ubuntu packages - run: | - sudo apt-get update - grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends - # Ruby for asciidoctor - - name: Setup Ruby and Gemfile content - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2.0" - bundler-cache: true - # Node.js for wavedrom - - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - - name: Install Node.js dependencies - run: npm install ${NPM_PACKAGE_FOLDER} - - name: Generate PDF - working-directory: ./build - run: | - PATH=${PATH}:${BUNDLE_BIN}:$(npm bin) \ - make -f priv.mk - - name: Archive PDF result - uses: actions/upload-artifact@v3 - with: - name: ${{ env.NAME }}.pdf - path: ./build/${{ env.NAME }}.pdf - retention-days: 7 diff --git a/.github/workflows/build-unpriv-pdf.yml b/.github/workflows/build-unpriv-pdf.yml deleted file mode 100644 index 527247f..0000000 --- a/.github/workflows/build-unpriv-pdf.yml +++ /dev/null @@ -1,75 +0,0 @@ -# This workflow installs dependencies for PDF generation, generates the PDF, -# and uploads the PDF as an artifact. - -name: Build Unpriv PDF - -on: - workflow_dispatch: - workflow_call: - outputs: - name: - description: "The base name of the pdf file (without .pdf extensions)" - value: ${{ jobs.build.outputs.name }} - pdf-name: - description: "The name of the pdf file (with .pdf extensions)" - value: ${{ jobs.build.outputs.pdf-name }} - -jobs: - build: - runs-on: ubuntu-latest - - env: - NAME: unpriv-isa-asciidoc - APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt - BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile - BUNDLE_BIN: ${{ github.workspace }}/bin - NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies - outputs: - name: ${{ steps.step1.outputs.name }} - pdf-name: ${{ steps.step2.outputs.pdf-name }} - if: contains(github.ref, 'riscv-isa-asciidoc') - steps: - - name: Set outputs.name - id: step1 - run: echo "name=$NAME" >> $GITHUB_OUTPUT - - name: Set outputs.pdf-name - id: step2 - run: echo "pdf-name=$NAME.pdf" >> $GITHUB_OUTPUT - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Install Ubuntu packages - run: | - sudo apt-get update - grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends - # Ruby for asciidoctor - - name: Setup Ruby and Gemfile content - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2.0" - bundler-cache: true - # Node.js for wavedrom - - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - - name: Install Node.js dependencies - run: npm install ${NPM_PACKAGE_FOLDER} - - name: Generate PDF - working-directory: ./build - run: | - PATH=${PATH}:${BUNDLE_BIN}:$(npm bin) \ - make -f unpriv.mk - - name: Archive PDF result - uses: actions/upload-artifact@v3 - with: - name: ${{ env.NAME }}.pdf - path: ./build/${{ env.NAME }}.pdf - retention-days: 7 diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml deleted file mode 100644 index 014c0e5..0000000 --- a/.github/workflows/create-release.yml +++ /dev/null @@ -1,43 +0,0 @@ -# This work flow includes source and PDF in Release. It relies on the build-pdf workflow to create the PDF. -# -# NOTE: At this time it only runs manually. - -name: Create Document Release - -on: - workflow_dispatch: - inputs: - version: - description: 'Release version, e.g. X.Y.Z:' - required: true - type: string - 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 - -jobs: - build: - uses: ./.github/workflows/build-pdf.yml - release: - runs-on: ubuntu-latest - needs: build - steps: - - name: Download Artifacts - uses: actions/download-artifact@v3 - with: - name: ${{ needs.build.outputs.pdf-name }} - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - files: ${{ needs.build.outputs.pdf-name }} - tag_name: v${{ github.event.inputs.version }} - name: Release ${{ github.event.inputs.version }} - draft: ${{ github.event.inputs.draft }} - prerelease: ${{ github.event.inputs.prerelease }} diff --git a/.github/workflows/build-pdf-and-html.yml b/.github/workflows/isa-build.yml index 2afe232..7135c26 100644 --- a/.github/workflows/build-pdf-and-html.yml +++ b/.github/workflows/isa-build.yml @@ -1,15 +1,25 @@ -name: Build RISC-V ISA +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 - - riscv-isa-asciidoc pull_request: branches: - main - - riscv-isa-asciidoc jobs: build: @@ -19,26 +29,34 @@ jobs: # Checkout the repository - name: Checkout repository uses: actions/checkout@v3 + + # 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 # Pull the latest RISC-V Docs container image # https://github.com/riscv/riscv-docs-base-container-image # https://hub.docker.com/r/riscvintl/riscv-docs-base-container-image - name: Pull Container + id: pull_container_image run: | docker pull riscvintl/riscv-docs-base-container-image:latest # Build PDF and HTML files using the container - name: Build Files + id: build_files + if: steps.pull_container_image.outcome == 'success' run: | docker run --rm -v ${{ github.workspace }}:/build riscvintl/riscv-docs-base-container-image:latest \ /bin/sh -c 'cd ./build && make' - # Set the short SHA for use in artifact names - - name: Set short SHA - run: echo "SHORT_SHA=$(echo ${GITHUB_SHA::7})" >> $GITHUB_ENV - # Upload the priv-isa-asciidoc PDF file - name: Upload priv-isa-asciidoc.pdf + if: steps.build_files.outcome == 'success' uses: actions/upload-artifact@v3 with: name: priv-isa-asciidoc-${{ env.SHORT_SHA }}.pdf @@ -47,6 +65,7 @@ jobs: # Upload the priv-isa-asciidoc HTML file - name: Upload priv-isa-asciidoc.html + if: steps.build_files.outcome == 'success' uses: actions/upload-artifact@v3 with: name: priv-isa-asciidoc-${{ env.SHORT_SHA }}.html @@ -55,6 +74,7 @@ jobs: # Upload the unpriv-isa-asciidoc PDF file - name: Upload unpriv-isa-asciidoc.pdf + if: steps.build_files.outcome == 'success' uses: actions/upload-artifact@v3 with: name: unpriv-isa-asciidoc-${{ env.SHORT_SHA }}.pdf @@ -63,6 +83,7 @@ jobs: # Upload the unpriv-isa-asciidoc HTML file - name: Upload unpriv-isa-asciidoc.html + if: steps.build_files.outcome == 'success' uses: actions/upload-artifact@v3 with: name: unpriv-isa-asciidoc-${{ env.SHORT_SHA }}.html @@ -71,20 +92,23 @@ jobs: # Upload the priv-isa-latex PDF file - name: Upload riscv-privileged.pdf + if: steps.build_files.outcome == 'success' uses: actions/upload-artifact@v3 with: name: riscv-privileged-latex-${{ env.SHORT_SHA }}.pdf path: ${{ github.workspace }}/build/riscv-privileged.pdf retention-days: 7 - # Create a draft release with generated files - - name: Create Draft Release - if: (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/asciidoc')) || (github.event.pull_request.merged == true && (github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'asciidoc')) + - 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@v1 with: - draft: true - tag_name: ${{ env.SHORT_SHA }} - release_name: Draft-${{ env.SHORT_SHA }} + 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/priv-isa-asciidoc.pdf ${{ github.workspace }}/build/priv-isa-asciidoc.html @@ -93,3 +117,4 @@ jobs: ${{ github.workspace }}/build/riscv-privileged.pdf env: GITHUB_TOKEN: ${{ secrets.GHTOKEN }} +
\ No newline at end of file |