Skip to content

Commit bb7399c

Browse files
authored
Merge pull request #73 from arichardson/fix-issue-72
Don't override VERSION and REVMARK for default actions builds
2 parents 9bb8f4b + 2fa7e5f commit bb7399c

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

.github/workflows/build-pdf.yml

+19-11
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ on:
1212
revision_mark:
1313
description: 'Set revision mark as Draft, Release or Stable:'
1414
required: true
15-
type: string
15+
type: choice
16+
options:
17+
- Draft
18+
- Release
19+
- Stable
1620
default: Draft
1721
prerelease:
1822
description: Tag as a pre-release?
@@ -39,24 +43,28 @@ jobs:
3943
runs-on: ubuntu-latest
4044

4145
steps:
42-
# Checkout the repository
46+
# Checkout the repository
4347
- name: Checkout repository
4448
uses: actions/checkout@v4
4549
with:
4650
submodules: recursive
4751

48-
# Pull the latest RISC-V Docs container image
52+
# Pull the latest RISC-V Docs container image
4953
- name: Pull Container
5054
run: docker pull riscvintl/riscv-docs-base-container-image:latest
5155

52-
# Build PDF and HTML.
56+
# Override VERSION and REVMARK for manual workflow dispatch
57+
- name: Update environment variables
58+
run: |
59+
echo "VERSION=v${{ github.event.inputs.version }}" >> "$GITHUB_ENV"
60+
echo "REVMARK=${{ github.event.inputs.revision_mark }}" >> "$GITHUB_ENV"
61+
if: github.event_name == 'workflow_dispatch'
62+
63+
# Build PDF and HTML.
5364
- name: Build Files
5465
run: make all
55-
env:
56-
VERSION: v${{ github.event.inputs.version }}
57-
REVMARK: ${{ github.event.inputs.revision_mark }}
5866

59-
# Upload the built PDF and HTML files as a single artifact
67+
# Upload the built PDF and HTML files as a single artifact
6068
- name: Upload Build Artifacts
6169
uses: actions/upload-artifact@v3
6270
with:
@@ -66,7 +74,7 @@ jobs:
6674
build/*.html
6775
retention-days: 30
6876

69-
# Upload gitlab pages artefact.
77+
# Upload GitHub pages artefacts.
7078
- name: Make gitlab pages directory
7179
run: mkdir dist && cp build/*.html dist/index.html
7280
if: github.event_name == 'workflow_dispatch'
@@ -77,7 +85,7 @@ jobs:
7785
path: dist
7886
if: github.event_name == 'workflow_dispatch'
7987

80-
# Create Release
88+
# Create Release
8189
- name: Create Release
8290
uses: softprops/action-gh-release@v1
8391
with:
@@ -91,7 +99,7 @@ jobs:
9199
env:
92100
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
93101
if: github.event_name == 'workflow_dispatch'
94-
# This condition ensures this step only runs for workflow_dispatch events.
102+
# This condition ensures this step only runs for workflow_dispatch events.
95103

96104
# Deploy HTML to Github pages.
97105
deploy:

0 commit comments

Comments
 (0)