-
Notifications
You must be signed in to change notification settings - Fork 33
78 lines (68 loc) · 2.19 KB
/
build-pdf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build All PDFs
# The workflow is triggered by pull request, push to main, and manual dispatch.
on:
workflow_dispatch:
inputs:
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@v4
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: cd ./docs && make
# Step 4: Upload the built PDF files as independent artifacts
- name: Upload RISC-V-Trace-Control-Interface PDF
uses: actions/upload-artifact@v4
with:
name: RISC-V-Trace-Control-Interface
path: ${{ github.workspace }}/docs/RISC-V-Trace-Control-Interface.pdf
retention-days: 30
- name: Upload RISC-V-Trace-Connectors PDF
uses: actions/upload-artifact@v4
with:
name: RISC-V-Trace-Connectors
path: ${{ github.workspace }}/docs/RISC-V-Trace-Connectors.pdf
retention-days: 30
- name: Upload RISC-V-N-Trace PDF
uses: actions/upload-artifact@v4
with:
name: RISC-V-N-Trace
path: ${{ github.workspace }}/docs/RISC-V-N-Trace.pdf
retention-days: 30
- name: Get short SHA
id: short-sha
run: echo "SHORT_SHA=$(git rev-parse --short=4 HEAD)" >> $GITHUB_ENV
# Step 5:Create Release
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{ github.workspace }}/docs/*.pdf
tag_name: v${{ env.SHORT_SHA }}
name: Release ${{ env.SHORT_SHA }}
draft: ${{ github.event.inputs.draft }}
prerelease: ${{ github.event.inputs.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
if: github.event_name == 'workflow_dispatch'