Skip to content

Commit

Permalink
Tweaks and fixes to scripts and docs to support 10.1 (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis authored Jan 26, 2025
1 parent 9c16057 commit c64668e
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 38 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
permissions:
contents: write # Needs to be able to write to the repo.
name: Build Documentation
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

concurrency:
group: docs-deployment
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
with:
php-version: '8.0'
php-version: '8.3'

- name: Checkout D++
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -44,4 +44,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

41 changes: 41 additions & 0 deletions .github/workflows/release-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docs Full Rebuild (dpp.dev)
on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
docs:
permissions:
contents: write # Needs to be able to write to the repo.
name: Rebuild all Documentation
runs-on: ubuntu-24.04

concurrency:
group: docs-deployment
cancel-in-progress: true

steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Setup PHP
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
with:
php-version: '8.3'

- name: Checkout D++
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive

- name: Generate Docs
run: cd docpages && php makedocs-gh.php rebuild-old
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
7 changes: 4 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

| Version | Supported |
| ------- | ------------------ |
| 10.0.x ||
| 9.0.x ||
| 1.0.x ||
| 10.1.x | ✅ Feature release |
| 10.0.x | ✅ Fixes only |
| 9.0.x | ⛔ Deprecated |
| 1.0.x | ⛔ Deprecated |

## Reporting a Vulnerability

Expand Down
62 changes: 32 additions & 30 deletions docpages/makedocs-gh.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,36 +71,38 @@
exit(0);
}

/* Create old version docs */
chdir("/home/runner/work/DPP/DPP");
system("rm -rf " . sys_get_temp_dir() . "/dpp-old");
mkdir(sys_get_temp_dir() . "/dpp-old");

/* Fire up async tasks to run instances of doxygen for each past version */
$asyncRunners = [];
foreach ($tags as $tag) {
$orig_tag = $tag;
$tag = preg_replace("/^v/", "", $tag);
if (!empty($tag)) {
$asyncRunners[$tag] = true;
$pid = pcntl_fork();
if ($pid == 0) {
posix_setsid();
pcntl_exec(PHP_BINARY, ["docpages/makedocs-gh-single.php", $tag, $orig_tag], $_ENV);
exit(0);
}
}
}

/* Wait for all async tasks to complete */
while (count($asyncRunners)) {
foreach ($asyncRunners as $tag => $discarded) {
if (file_exists("/tmp/completion_$tag") && file_get_contents("/tmp/completion_$tag") == $tag) {
unset($asyncRunners[$tag]);
echo "Runner for $tag is completed.\n";
}
}
sleep(1);
if (count($_ARGV) > 1 && $_ARGV[1] === 'rebuild-old') {
/* Create old version docs */
chdir("/home/runner/work/DPP/DPP");
system("rm -rf " . sys_get_temp_dir() . "/dpp-old");
mkdir(sys_get_temp_dir() . "/dpp-old");

/* Fire up async tasks to run instances of doxygen for each past version */
$asyncRunners = [];
foreach ($tags as $tag) {
$orig_tag = $tag;
$tag = preg_replace("/^v/", "", $tag);
if (!empty($tag)) {
$asyncRunners[$tag] = true;
$pid = pcntl_fork();
if ($pid == 0) {
posix_setsid();
pcntl_exec(PHP_BINARY, ["docpages/makedocs-gh-single.php", $tag, $orig_tag], $_ENV);
exit(0);
}
}
}

/* Wait for all async tasks to complete */
while (count($asyncRunners)) {
foreach ($asyncRunners as $tag => $discarded) {
if (file_exists("/tmp/completion_$tag") && file_get_contents("/tmp/completion_$tag") == $tag) {
unset($asyncRunners[$tag]);
echo "Runner for $tag is completed.\n";
}
}
sleep(1);
}
}

/* Commit and push everything to the github pages repo */
Expand Down
3 changes: 1 addition & 2 deletions sign.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
rm -rf build/sign
mkdir -p build/sign
cd build/sign
cd build/sign || exit
gh release download "$1" -A tar.gz
sleep 2
gh release download "$1" -A zip
Expand All @@ -11,4 +11,3 @@ sleep 2
rm -fv *.asc
find . -type f -exec gpg --armor --detach-sign {} \;
gh release upload "$1" ./* --clobber

0 comments on commit c64668e

Please sign in to comment.