Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaks and fixes to scripts and docs to support 10.1 #1365

Merged
merged 4 commits into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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
@@ -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

62 changes: 32 additions & 30 deletions docpages/makedocs-gh.php
Original file line number Diff line number Diff line change
@@ -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 */
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
@@ -11,4 +11,3 @@ sleep 2
rm -fv *.asc
find . -type f -exec gpg --armor --detach-sign {} \;
gh release upload "$1" ./* --clobber