Skip to content

Commit 1edd16b

Browse files
committed
Update the build process to build using the base container image
and remove the necessity to handle the dependencies during the build time Signed-off-by: Rafael Sene <[email protected]>
1 parent 586c72a commit 1edd16b

23 files changed

+233
-244
lines changed
Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,38 @@
1-
# This workflow installs dependencies for PDF generation, generates the PDF,
2-
# and uploads the PDF as an artifact.
3-
41
name: Build RISC-V-Trace-Connectors.pdf
52

63
on:
74
push:
85
branches:
6+
- master
97
- main
108
pull_request:
119
branches:
10+
- master
1211
- main
1312
workflow_dispatch:
1413

1514
jobs:
1615
build:
1716
runs-on: ubuntu-latest
18-
19-
env:
20-
APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt
21-
BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile
22-
BUNDLE_BIN: ${{ github.workspace }}/bin
23-
NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies
2417
steps:
25-
- name: Checkout repository
26-
uses: actions/checkout@v3
27-
with:
28-
submodules: 'true'
29-
- name: Install Ubuntu packages
30-
run: |
31-
sudo apt-get update
32-
grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends
33-
# Ruby for asciidoctor
34-
- name: Setup Ruby and Gemfile content
35-
uses: ruby/setup-ruby@v1
36-
with:
37-
ruby-version: "3.2.0"
38-
bundler-cache: true
39-
# Node.js for wavedrom
40-
- uses: actions/cache@v3
41-
with:
42-
path: ~/.npm
43-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
44-
restore-keys: |
45-
${{ runner.os }}-node-
46-
- name: Setup Node.js
47-
uses: actions/setup-node@v3
48-
with:
49-
node-version: '16'
50-
- name: Install Node.js dependencies
51-
run: npm install ${NPM_PACKAGE_FOLDER}
52-
- name: Generate PDF
53-
run: |
54-
PATH=${PATH}:${BUNDLE_BIN}:$(npm bin):$(pwd) \
55-
make -C docs/ RISC-V-Trace-Connectors.pdf
56-
- name: Archive PDF result
57-
uses: actions/upload-artifact@v3
58-
with:
59-
name: RISC-V-Trace-Connectors
60-
path: docs/RISC-V-Trace-Connectors.pdf
61-
retention-days: 7
18+
# Step 1: Checkout the repository
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
with:
22+
submodules: 'recursive'
23+
24+
# Step 2: Pull the latest RISC-V Docs container image
25+
- name: Pull Container
26+
run: docker pull riscvintl/riscv-docs-base-container-image:latest
27+
28+
# Step 3: Build Files
29+
- name: Build Files
30+
run: cd ./docs && make RISC-V-Trace-Connectors.pdf
31+
32+
# Step 4: Upload the built PDF files as independent artifacts
33+
- name: Upload RISC-V-Trace-Control-Interface PDF
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: RISC-V-Trace-Control-Interface
37+
path: ${{ github.workspace }}/docs/RISC-V-Trace-Connectors.pdf
38+
retention-days: 7
Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,38 @@
1-
# This workflow installs dependencies for PDF generation, generates the PDF,
2-
# and uploads the PDF as an artifact.
3-
41
name: Build RISC-V-Trace-Control-Interface.pdf
52

63
on:
74
push:
85
branches:
6+
- master
97
- main
108
pull_request:
119
branches:
10+
- master
1211
- main
1312
workflow_dispatch:
1413

1514
jobs:
1615
build:
1716
runs-on: ubuntu-latest
18-
19-
env:
20-
APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt
21-
BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile
22-
BUNDLE_BIN: ${{ github.workspace }}/bin
23-
NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies
2417
steps:
25-
- name: Checkout repository
26-
uses: actions/checkout@v3
27-
with:
28-
submodules: 'true'
29-
- name: Install Ubuntu packages
30-
run: |
31-
sudo apt-get update
32-
grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends
33-
# Ruby for asciidoctor
34-
- name: Setup Ruby and Gemfile content
35-
uses: ruby/setup-ruby@v1
36-
with:
37-
ruby-version: "3.2.0"
38-
bundler-cache: true
39-
# Node.js for wavedrom
40-
- uses: actions/cache@v3
41-
with:
42-
path: ~/.npm
43-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
44-
restore-keys: |
45-
${{ runner.os }}-node-
46-
- name: Setup Node.js
47-
uses: actions/setup-node@v3
48-
with:
49-
node-version: '16'
50-
- name: Install Node.js dependencies
51-
run: npm install ${NPM_PACKAGE_FOLDER}
52-
- name: Generate PDF
53-
run: |
54-
PATH=${PATH}:${BUNDLE_BIN}:$(npm bin):$(pwd) \
55-
make -C docs/ RISC-V-Trace-Control-Interface.pdf
56-
- name: Archive PDF result
57-
uses: actions/upload-artifact@v3
58-
with:
59-
name: RISC-V-Trace-Control-Interface
60-
path: docs/RISC-V-Trace-Control-Interface.pdf
61-
retention-days: 7
18+
# Step 1: Checkout the repository
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
with:
22+
submodules: 'recursive'
23+
24+
# Step 2: Pull the latest RISC-V Docs container image
25+
- name: Pull Container
26+
run: docker pull riscvintl/riscv-docs-base-container-image:latest
27+
28+
# Step 3: Build Files
29+
- name: Build Files
30+
run: cd ./docs && make RISC-V-Trace-Control-Interface.pdf
31+
32+
# Step 4: Upload the built PDF files as independent artifacts
33+
- name: Upload RISC-V-Trace-Control-Interface PDF
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: RISC-V-Trace-Control-Interface
37+
path: ${{ github.workspace }}/docs/RISC-V-Trace-Control-Interface.pdf
38+
retention-days: 7
Lines changed: 24 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,38 @@
1-
# This workflow installs dependencies for PDF generation, generates the PDF,
2-
# and uploads the PDF as an artifact.
3-
4-
name: Build RISC-V-N-Trace.pdf
1+
name: Build Build RISC-V-N-Trace.pdf
52

63
on:
74
push:
85
branches:
6+
- master
97
- main
108
pull_request:
119
branches:
10+
- master
1211
- main
1312
workflow_dispatch:
1413

1514
jobs:
1615
build:
1716
runs-on: ubuntu-latest
18-
19-
env:
20-
APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt
21-
BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile
22-
BUNDLE_BIN: ${{ github.workspace }}/bin
23-
NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies
2417
steps:
25-
- name: Checkout repository
26-
uses: actions/checkout@v3
27-
with:
28-
submodules: 'true'
29-
- name: Install Ubuntu packages
30-
run: |
31-
sudo apt-get update
32-
grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends
33-
# Ruby for asciidoctor
34-
- name: Setup Ruby and Gemfile content
35-
uses: ruby/setup-ruby@v1
36-
with:
37-
ruby-version: "3.2.0"
38-
bundler-cache: true
39-
# Node.js for wavedrom
40-
- uses: actions/cache@v3
41-
with:
42-
path: ~/.npm
43-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
44-
restore-keys: |
45-
${{ runner.os }}-node-
46-
- name: Setup Node.js
47-
uses: actions/setup-node@v3
48-
with:
49-
node-version: '16'
50-
- name: Install Node.js dependencies
51-
run: npm install ${NPM_PACKAGE_FOLDER}
52-
- name: Generate PDF
53-
run: |
54-
PATH=${PATH}:${BUNDLE_BIN}:$(npm bin):$(pwd) \
55-
make -C docs/ RISC-V-N-Trace.pdf
56-
- name: Archive PDF result
57-
uses: actions/upload-artifact@v3
58-
with:
59-
name: RISC-V-N-Trace
60-
path: docs/RISC-V-N-Trace.pdf
61-
retention-days: 7
18+
# Step 1: Checkout the repository
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
with:
22+
submodules: 'recursive'
23+
24+
# Step 2: Pull the latest RISC-V Docs container image
25+
- name: Pull Container
26+
run: docker pull riscvintl/riscv-docs-base-container-image:latest
27+
28+
# Step 3: Build Files
29+
- name: Build Files
30+
run: cd ./docs && make RISC-V-N-Trace.pdf
31+
32+
# Step 4: Upload the built PDF files as independent artifacts
33+
- name: Upload RISC-V-Trace-Control-Interface PDF
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: RISC-V-Trace-Control-Interface
37+
path: ${{ github.workspace }}/docs/RISC-V-N-Trace.pdf
38+
retention-days: 7

.github/workflows/build-pdf.yml

Lines changed: 61 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,79 @@
1-
# This workflow installs dependencies for PDF generation, generates the PDF,
2-
# and uploads the PDF as an artifact.
3-
4-
name: Build ALL PDFs (listed below)
1+
name: Build All PDFs
52

3+
# The workflow is triggered by pull request, push to main, and manual dispatch.
64
on:
7-
push:
8-
branches:
9-
- main
5+
workflow_dispatch:
6+
inputs:
7+
prerelease:
8+
description: 'Tag as a pre-release?'
9+
required: false
10+
type: boolean
11+
default: true
12+
draft:
13+
description: 'Create release as a draft?'
14+
required: false
15+
type: boolean
16+
default: false
1017
pull_request:
18+
push:
1119
branches:
20+
- master
1221
- main
13-
workflow_dispatch:
1422

1523
jobs:
1624
build:
1725
runs-on: ubuntu-latest
1826

19-
env:
20-
APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt
21-
BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile
22-
BUNDLE_BIN: ${{ github.workspace }}/bin
23-
NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies
2427
steps:
28+
# Step 1: Checkout the repository
2529
- name: Checkout repository
2630
uses: actions/checkout@v3
2731
with:
28-
submodules: 'true'
29-
- name: Install Ubuntu packages
30-
run: |
31-
sudo apt-get update
32-
grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends
33-
# Ruby for asciidoctor
34-
- name: Setup Ruby and Gemfile content
35-
uses: ruby/setup-ruby@v1
36-
with:
37-
ruby-version: "3.2.0"
38-
bundler-cache: true
39-
# Node.js for wavedrom
40-
- uses: actions/cache@v3
32+
submodules: 'recursive'
33+
34+
# Step 2: Pull the latest RISC-V Docs container image
35+
- name: Pull Container
36+
run: docker pull riscvintl/riscv-docs-base-container-image:latest
37+
38+
# Step 3: Build Files
39+
- name: Build Files
40+
run: cd ./docs && make
41+
42+
# Step 4: Upload the built PDF files as independent artifacts
43+
- name: Upload RISC-V-Trace-Control-Interface PDF
44+
uses: actions/upload-artifact@v3
4145
with:
42-
path: ~/.npm
43-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
44-
restore-keys: |
45-
${{ runner.os }}-node-
46-
- name: Setup Node.js
47-
uses: actions/setup-node@v3
46+
name: RISC-V-Trace-Control-Interface
47+
path: ${{ github.workspace }}/docs/RISC-V-Trace-Control-Interface.pdf
48+
retention-days: 30
49+
50+
- name: Upload RISC-V-Trace-Connectors PDF
51+
uses: actions/upload-artifact@v3
4852
with:
49-
node-version: '16'
50-
- name: Install Node.js dependencies
51-
run: npm install ${NPM_PACKAGE_FOLDER}
52-
- name: Generate PDF
53-
run: |
54-
PATH=${PATH}:${BUNDLE_BIN}:$(npm bin):$(pwd) \
55-
make -C docs/ all
56-
- name: Archive PDF result
53+
name: RISC-V-Trace-Connectors
54+
path: ${{ github.workspace }}/docs/RISC-V-Trace-Connectors.pdf
55+
retention-days: 30
56+
57+
- name: Upload RISC-V-N-Trace PDF
5758
uses: actions/upload-artifact@v3
5859
with:
59-
name: AllPDFs.zip
60-
path: docs/*.pdf
61-
retention-days: 21
60+
name: RISC-V-N-Trace
61+
path: ${{ github.workspace }}/docs/RISC-V-N-Trace.pdf
62+
retention-days: 30
63+
64+
- name: Get short SHA
65+
id: short-sha
66+
run: echo "SHORT_SHA=$(git rev-parse --short=4 HEAD)" >> $GITHUB_ENV
67+
68+
# Step 5:Create Release
69+
- name: Create Release
70+
uses: softprops/action-gh-release@v1
71+
with:
72+
files: ${{ github.workspace }}/docs/*.pdf
73+
tag_name: v${{ env.SHORT_SHA }}
74+
name: Release ${{ env.SHORT_SHA }}
75+
draft: ${{ github.event.inputs.draft }}
76+
prerelease: ${{ github.event.inputs.prerelease }}
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
79+
if: github.event_name == 'workflow_dispatch'

dependencies/Gemfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

dependencies/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)