Skip to content

Harden release integrity, licensing, and provenance #18

Harden release integrity, licensing, and provenance

Harden release integrity, licensing, and provenance #18

Workflow file for this run

name: Deploy GitHub Pages
on:
push:
branches: [main]
paths:
- "docs/**"
- "README.md"
- "LICENSE"
- "COMMERCIAL-LICENSE.md"
- "THIRD_PARTY_NOTICES.md"
- "scripts/generate-release-pdfs.py"
- "scripts/validate-public-content.py"
- ".github/workflows/pages.yml"
pull_request:
branches: [main]
paths:
- "docs/**"
- "README.md"
- "LICENSE"
- "COMMERCIAL-LICENSE.md"
- "THIRD_PARTY_NOTICES.md"
- "scripts/generate-release-pdfs.py"
- "scripts/validate-public-content.py"
- ".github/workflows/pages.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
name: Validate website, licensing, and generated documents
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Install deterministic document dependencies
run: python3 -m pip install --disable-pip-version-check reportlab==4.4.9 pypdf==6.4.1
- name: Verify generated PDFs
run: python3 scripts/generate-release-pdfs.py --check
- name: Validate public wording
run: python3 scripts/validate-public-content.py
- name: Verify landing-page sources
shell: bash
run: |
set -euo pipefail
test -f docs/index.html
test -f docs/styles.css
test -f docs/app.js
test -f docs/site.webmanifest
test -f docs/assets/branding/favicon.ico
test -f docs/screenshot/analyzer-overview.webp
grep -q 'GPL-3.0-or-later' docs/index.html
grep -q '1.4.0-beta.2' docs/index.html
! grep -qi 'Free and open source under Apache-2.0' docs/index.html
! grep -qi 'source code is licensed under Apache-2.0' docs/index.html
- name: Configure Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
- name: Upload Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: ./docs
deploy:
name: Deploy product website
if: github.event_name != 'pull_request'
needs: validate
runs-on: ubuntu-24.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
outputs:
page_url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5
smoke:
name: Verify deployed GPL website
if: github.event_name != 'pull_request'
needs: deploy
runs-on: ubuntu-24.04
steps:
- name: Wait for deployment propagation and verify public content
env:
PAGE_URL: ${{ needs.deploy.outputs.page_url }}
shell: bash
run: |
set -euo pipefail
for attempt in $(seq 1 18); do
if curl --fail --silent --show-error --location --max-time 20 "$PAGE_URL" -o deployed.html; then
if grep -q 'GPL-3.0-or-later' deployed.html \
&& grep -q '1.4.0-beta.2' deployed.html \
&& ! grep -qi 'Free and open source under Apache-2.0' deployed.html \
&& ! grep -qi 'source code is licensed under Apache-2.0' deployed.html; then
echo "Deployed website validation passed: $PAGE_URL"
exit 0
fi
fi
echo "Deployment not current yet (attempt $attempt/18); retrying..."
sleep 10
done
echo "Deployed website did not reach the expected GPL/version state: $PAGE_URL" >&2
cat deployed.html 2>/dev/null || true
exit 1