Skip to content

Commit c2b8641

Browse files
committed
add pull-request and release pipelines
1 parent cc314cb commit c2b8641

3 files changed

Lines changed: 204 additions & 0 deletions

File tree

.github/workflows/pr.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Pull request pipeline
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
# for security reasons the github actions are pinned to specific release versions
10+
jobs:
11+
link_checker:
12+
name: Link checker
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: Checkout markdown
16+
uses: actions/checkout@v4.2.0
17+
18+
- name: Link Checker
19+
uses: lycheeverse/lychee-action@v2.3.0
20+
with:
21+
args: >-
22+
--no-progress
23+
--max-retries 5
24+
'./docs/**/*.md'
25+
fail: true
26+
env:
27+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
28+
29+
md_linter:
30+
name: Lint markdown
31+
runs-on: ubuntu-24.04
32+
steps:
33+
- name: Checkout markdown
34+
uses: actions/checkout@v4.2.0
35+
36+
- name: Lint markdown
37+
uses: DavidAnson/markdownlint-cli2-action@v19.1.0
38+
with:
39+
config: '.markdownlint.yaml'
40+
globs: 'docs/**/*.md'
41+
42+
spell_checker:
43+
name: Check spelling
44+
runs-on: ubuntu-24.04
45+
steps:
46+
- name: Checkout markdown
47+
uses: actions/checkout@v4.2.0
48+
49+
- name: Spell check EN language
50+
uses: rojopolis/spellcheck-github-actions@0.47.0
51+
with:
52+
config_path: .spellcheck-en.yaml
53+
54+
export_pdf:
55+
name: Export PDF
56+
runs-on: ubuntu-24.04
57+
needs: [link_checker, md_linter, spell_checker]
58+
steps:
59+
- name: Checkout markdown
60+
uses: actions/checkout@v4.2.0
61+
62+
- name: Install python
63+
uses: actions/setup-python@v5.5.0
64+
with:
65+
python-version: 3.x
66+
67+
- name: Install python packages
68+
run: |
69+
python -m pip install --upgrade pip setuptools wheel
70+
pip install mkdocs
71+
pip install mkdocs-material
72+
pip install mkdocs-open-in-new-tab
73+
pip install mkdocs-with-pdf
74+
75+
- name: Build
76+
run: mkdocs build
77+
78+
- name: Upload PDF
79+
uses: actions/upload-artifact@v4.6.0
80+
with:
81+
name: pdf-export
82+
path: site/OWASP_Developer_Guide.pdf

.github/workflows/release.yaml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Release docs
2+
# checks are only on the draft directory because the release directory will be overwritten
3+
4+
on:
5+
push:
6+
# tagged x.x.x releases as well as release candidates
7+
tags:
8+
- ?.?.?*
9+
workflow_dispatch:
10+
11+
# for security reasons the github actions are pinned to specific release versions
12+
jobs:
13+
link_checker:
14+
name: Link checker
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout markdown
18+
uses: actions/checkout@v4.2.0
19+
20+
- name: Link Checker
21+
uses: lycheeverse/lychee-action@v2.3.0
22+
with:
23+
args: >-
24+
--no-progress
25+
--max-retries 5
26+
'./docs/**/*.md'
27+
fail: true
28+
env:
29+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
30+
31+
md_linter:
32+
name: Lint markdown
33+
runs-on: ubuntu-24.04
34+
steps:
35+
- name: Checkout markdown
36+
uses: actions/checkout@v4.2.0
37+
38+
- name: Lint markdown
39+
uses: DavidAnson/markdownlint-cli2-action@v19.1.0
40+
with:
41+
config: '.markdownlint.yaml'
42+
globs: 'docs/**/*.md'
43+
44+
spell_checker:
45+
name: Check spelling
46+
runs-on: ubuntu-24.04
47+
steps:
48+
- name: Checkout markdown
49+
uses: actions/checkout@v4.2.0
50+
51+
- name: Spell check EN language
52+
uses: rojopolis/spellcheck-github-actions@0.47.0
53+
with:
54+
config_path: .spellcheck-en.yaml
55+
56+
export_pdf:
57+
name: Export PDF
58+
runs-on: ubuntu-24.04
59+
needs: [link_checker, md_linter, spell_checker]
60+
steps:
61+
- name: Checkout markdown
62+
uses: actions/checkout@v4.2.0
63+
64+
- name: Install python
65+
uses: actions/setup-python@v5.5.0
66+
with:
67+
python-version: 3.x
68+
69+
- name: Install python packages
70+
run: |
71+
python -m pip install --upgrade pip setuptools wheel
72+
pip install mkdocs
73+
pip install mkdocs-material
74+
pip install mkdocs-open-in-new-tab
75+
pip install mkdocs-with-pdf
76+
77+
- name: Build
78+
run: mkdocs build
79+
80+
- name: Upload PDF
81+
uses: actions/upload-artifact@v4.6.0
82+
with:
83+
name: 'pdf-export'
84+
path: 'site/OWASP_Developer_Guide.pdf'
85+
86+
draft_release:
87+
name: Create draft release
88+
runs-on: ubuntu-24.04
89+
needs: [link_checker, md_linter, spell_checker]
90+
steps:
91+
- name: Check out
92+
uses: actions/checkout@v4.2.0
93+
94+
- name: Fetch prepared SBOM artifacts
95+
uses: actions/download-artifact@v4.2.1
96+
with:
97+
name: 'pdf-export'
98+
path: 'site/OWASP_Developer_Guide.pdf'
99+
100+
- name: Prepare release notes
101+
run: |
102+
releaseVersion=${{ github.ref_name }}
103+
sed -e s/x.x.x/${releaseVersion:1}/g .release-note-template.md > ./release-notes.txt
104+
105+
- name: Create release notes
106+
uses: softprops/action-gh-release@v2.2.0
107+
with:
108+
draft: true
109+
name: "${releaseVersion:1}"
110+
append_body: true
111+
body_path: ./release-notes.txt
112+
generate_release_notes: true
113+
files: |
114+
site/OWASP_Developer_Guide.pdf

.release-note-template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### What's Changed
2+
3+
### PDF version
4+
5+
The [PDF][pdf] version of the [web document][devguide] can be downloaded for version x.x.x .
6+
7+
[devguide]: devguide.owasp.org
8+
[pdf]: https://github.com/OWASP/threat-dragon/releases/download/vx.x.x/OWASP_Developer_Guide.pdf

0 commit comments

Comments
 (0)