|
| 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 |
0 commit comments