Skip to content

Commit 00cd189

Browse files
committed
Add CI/CD scripts from docs-template repo
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
1 parent 62a7de4 commit 00cd189

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
3+
version: 2
4+
updates:
5+
- package-ecosystem: gitsubmodule
6+
directory: /
7+
schedule:
8+
interval: daily

.github/workflows/build-pdf.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
name: Create Specification Document
3+
4+
# The workflow is triggered by pull request, push to main, and manual dispatch.
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
revision_mark:
9+
description: 'Set revision mark as Draft, Release or Stable:'
10+
required: true
11+
type: choice
12+
options:
13+
- Development
14+
- Stable
15+
- Frozen
16+
- Ratified
17+
default: Development
18+
prerelease:
19+
description: Tag as a pre-release?
20+
required: false
21+
type: boolean
22+
default: true
23+
draft:
24+
description: Create release as a draft?
25+
required: false
26+
type: boolean
27+
default: false
28+
pull_request:
29+
push:
30+
branches:
31+
- main
32+
33+
jobs:
34+
build:
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
# Checkout the repository
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
with:
42+
submodules: recursive
43+
44+
- name: Get next version
45+
uses: reecetech/version-increment@2024.4.4
46+
id: version
47+
with:
48+
scheme: semver
49+
increment: patch
50+
51+
# Pull the latest RISC-V Docs container image
52+
- name: Pull Container
53+
run: docker pull riscvintl/riscv-docs-base-container-image:latest
54+
55+
# Override VERSION and REVMARK for manual workflow dispatch
56+
- name: Update environment variables
57+
run: |
58+
echo "VERSION=v${{ steps.version.outputs.version }}" >> "$GITHUB_ENV"
59+
echo "REVMARK=${{ github.event.inputs.revision_mark }}" >> "$GITHUB_ENV"
60+
if: github.event_name == 'workflow_dispatch'
61+
62+
# Build Files
63+
- name: Build Files
64+
run: make
65+
66+
# Upload the built PDF files as a single artifact
67+
- name: Upload Build Artifacts
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: Build Artifacts
71+
path: ${{ github.workspace }}/build/*.pdf
72+
retention-days: 30
73+
74+
# Create Release
75+
- name: Create Release
76+
uses: softprops/action-gh-release@v1
77+
with:
78+
files: ${{ github.workspace }}/build/*.pdf
79+
tag_name: v${{ steps.version.outputs.version }}
80+
name: Release ${{ steps.version.outputs.version }}
81+
draft: ${{ github.event.inputs.draft }}
82+
prerelease: ${{ github.event.inputs.prerelease }}
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
85+
if: github.event_name == 'workflow_dispatch'
86+
# This condition ensures this step only runs for workflow_dispatch events.

.github/workflows/pre-commit.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: pre-commit
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
- uses: pre-commit/action@v3.0.0

0 commit comments

Comments
 (0)