Frozen - ready for public review #189
Workflow file for this run
This file contains hidden or 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
| --- | |
| name: Create Specification Document | |
| # The workflow is triggered by pull request, push to main/tags, and manual dispatch. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Release version (e.g. v0.8.1 or 0.8.1). Leave blank to auto-increment. | |
| required: false | |
| type: string | |
| revision_mark: | |
| description: 'Set revision mark as Draft, Release or Stable:' | |
| required: true | |
| type: choice | |
| options: | |
| - Development | |
| - Stable | |
| - Frozen | |
| - Ratified | |
| default: Development | |
| 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 | |
| tags: | |
| - '*' | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Get next version | |
| uses: reecetech/version-increment@2024.4.4 | |
| id: version | |
| with: | |
| scheme: semver | |
| increment: patch | |
| - name: Resolve version and revision mark | |
| shell: bash | |
| run: | | |
| raw_version="" | |
| if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then | |
| raw_version="${{ github.event.release.tag_name }}" | |
| elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| raw_version="${GITHUB_REF_NAME}" | |
| elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && -n "${{ github.event.inputs.version }}" ]]; then | |
| raw_version="${{ github.event.inputs.version }}" | |
| else | |
| raw_version="${{ steps.version.outputs.version }}" | |
| fi | |
| if [[ -z "$raw_version" ]]; then | |
| raw_version="0.0.0" | |
| fi | |
| if [[ "$raw_version" == v* ]]; then | |
| version="$raw_version" | |
| else | |
| version="v${raw_version}" | |
| fi | |
| echo "VERSION=$version" >> "$GITHUB_ENV" | |
| echo "VERSION_NO_V=${version#v}" >> "$GITHUB_ENV" | |
| if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then | |
| echo "REVMARK=${{ github.event.inputs.revision_mark }}" >> "$GITHUB_ENV" | |
| fi | |
| # Pull the latest RISC-V Docs container image | |
| - name: Pull Container | |
| run: docker pull riscvintl/riscv-docs-base-container-image:latest | |
| # 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 | |
| # Upload PDF files as individual artifact | |
| - name: Upload PDF Build Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hart-trace-interface${{ env.SHORT_SHA }}.pdf | |
| path: ${{ github.workspace }}/build/hart-trace-interface.pdf | |
| retention-days: 7 | |
| # Upload HTML files as individual artifact | |
| - name: Upload HTML Build Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hart-trace-interface${{ env.SHORT_SHA }}.html | |
| path: ${{ github.workspace }}/build/hart-trace-interface.html | |
| retention-days: 7 | |
| # Create Release (manual workflow only) | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ${{ github.workspace }}/build/*.pdf | |
| tag_name: ${{ env.VERSION }} | |
| name: Release ${{ env.VERSION_NO_V }} | |
| draft: ${{ github.event.inputs.draft }} | |
| prerelease: ${{ github.event.inputs.prerelease }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GHTOKEN }} | |
| if: github.event_name == 'workflow_dispatch' | |
| # Upload assets to an existing release (release event) | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ${{ github.workspace }}/build/*.pdf | |
| tag_name: ${{ env.VERSION }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GHTOKEN }} | |
| if: github.event_name == 'release' |