This guide describes how to create releases for Riksdagsmonitor with full attestations and documentation-as-code.
Document Classification: 🟢 Public
Last Updated: 2026-02-18
Owner: Hack23 AB
Review Cycle: Per release
- Overview
- Release Workflow
- Triggering a Release
- Release Artifacts
- Documentation as Code
- Security & Attestations
- Deployment
- Verification
- Troubleshooting
Riksdagsmonitor follows a comprehensive release process that includes:
- ✅ Automated testing (unit + E2E)
- ✅ Documentation generation (API, coverage, E2E reports)
- ✅ SLSA Build Provenance attestations
- ✅ SBOM (Software Bill of Materials) generation
- ✅ Dual deployment (S3/CloudFront + GitHub Pages)
- ✅ npm package publishing with provenance
- ✅ Automated release notes
The release workflow consists of 3 jobs:
Purpose: Build, test, and generate all documentation
Steps:
- Set up test environment (Xvfb, Chrome, dependencies)
- Install npm dependencies
- Build application with Vite
- Run unit tests with coverage
- Run E2E tests with Cypress
- Clean old documentation
- Generate API documentation (JSDoc)
- Generate dependency tree
- Copy test reports to docs/
- Create documentation index (docs/index.html)
- Update sitemap.xml
- Deploy documentation to GitHub Pages
Duration: ~10-15 minutes
Purpose: Create release artifacts with attestations
Steps:
- Build production application
- Create release zip file
- Generate SHA-256 checksum
- Generate SBOM (SPDX format)
- Create build provenance attestation
- Create SBOM attestation
- Upload artifacts
Duration: ~5 minutes
Purpose: Create GitHub release, publish npm package, and deploy to production
Steps:
- Download build and security artifacts
- Generate release notes with Release Drafter
- Create GitHub Release with all artifacts
- Build and publish npm package with provenance
- Extract build to repository root
- Deploy to S3/CloudFront with cache headers
- Invalidate CloudFront cache
- Display deployment summary
Duration: ~5-10 minutes
Total Workflow Duration: ~20-30 minutes
- Go to Actions → Release with Attestations → Run workflow
- Enter version (e.g.,
v1.0.0) - Select prerelease flag (if applicable)
- Click "Run workflow"
This will:
- Update package.json version
- Create and push a git tag
- Trigger the full release workflow
- Create and push a version tag:
git tag v1.0.0 git push origin v1.0.0
This will automatically trigger the release workflow.
Follow Semantic Versioning:
- Major (v2.0.0): Breaking changes
- Minor (v1.1.0): New features (backward compatible)
- Patch (v1.0.1): Bug fixes (backward compatible)
Each release includes the following artifacts:
-
riksdagsmonitor-vX.Y.Z.zip- Production build- Minified and optimized for production
- All HTML, CSS, JS, and assets
- Ready for deployment
-
riksdagsmonitor-vX.Y.Z.zip.sha256- Checksum- SHA-256 hash for integrity verification
-
riksdagsmonitor@X.Y.Z- Shared types and utilities- Published to npm with provenance attestation
- TypeScript type definitions for theme, chart, and dashboard types
- Theme system (dark/light cyberpunk theme, party colors, chart palettes)
- Chart.js factory and responsive utilities
- Data loading with fallback, caching, and retry
- DOM utilities, error boundaries, and fallback UI
npm install riksdagsmonitor
import { DARK_THEME_COLORS, LIGHT_THEME_COLORS, getActiveThemeColors, getPartyColor, CHART_PALETTE, BREAKPOINTS, } from 'riksdagsmonitor';
-
riksdagsmonitor-vX.Y.Z.spdx.json- SBOM- Software Bill of Materials in SPDX format
- Complete dependency inventory
- License information
-
riksdagsmonitor-vX.Y.Z.zip.intoto.jsonl- Build Provenance- SLSA Build Provenance attestation
- Verifiable build metadata
- Supply chain security
-
riksdagsmonitor-vX.Y.Z.spdx.json.intoto.jsonl- SBOM Attestation- Attestation for the SBOM
- Cryptographically signed
All documentation is generated during the release and committed to the docs/ directory:
docs/
├── index.html # Documentation hub (landing page)
├── .nojekyll # Bypass Jekyll processing
├── api/ # JSDoc API documentation
│ ├── index.html
│ ├── global.html
│ └── ...
├── coverage/ # Vitest coverage reports
│ ├── index.html # Interactive coverage viewer
│ ├── lcov.info
│ └── coverage-final.json
├── test-results/ # Vitest test results
├── cypress/ # Cypress E2E test reports
├── dependencies/ # npm dependency tree
│ ├── dependency-tree.json
│ └── dependency-tree.txt
└── diagrams/ # Architecture diagrams
- Documentation Hub: https://riksdagsmonitor.com/docs/
- API Documentation: https://riksdagsmonitor.com/docs/api/
- Test Coverage: https://riksdagsmonitor.com/docs/coverage/
- E2E Reports: https://riksdagsmonitor.com/docs/cypress/
- Dependencies: https://riksdagsmonitor.com/docs/dependencies/
Every release includes SLSA Build Provenance attestations that:
- Prove the artifact was built by GitHub Actions
- Include build metadata (commit SHA, workflow, runner)
- Are cryptographically signed and verifiable
Every release includes an SBOM in SPDX format that:
- Lists all dependencies (direct + transitive)
- Includes version information
- Provides license details
- Enables vulnerability tracking
Verify attestations using the GitHub CLI:
# Install GitHub CLI
brew install gh
# Verify build provenance
gh attestation verify riksdagsmonitor-v1.0.0.zip -R Hack23/riksdagsmonitor
# View attestation details
gh attestation view riksdagsmonitor-v1.0.0.zip -R Hack23/riksdagsmonitorVerify artifact integrity:
# Download artifacts
wget https://github.com/Hack23/riksdagsmonitor/releases/download/v1.0.0/riksdagsmonitor-v1.0.0.zip
wget https://github.com/Hack23/riksdagsmonitor/releases/download/v1.0.0/riksdagsmonitor-v1.0.0.zip.sha256
# Verify checksum
sha256sum -c riksdagsmonitor-v1.0.0.zip.sha256Every release is deployed to two locations:
- URL: https://riksdagsmonitor.com
- Infrastructure: S3 bucket + CloudFront CDN
- Benefits:
- Global CDN (low latency worldwide)
- Custom cache headers (1 hour HTML, 1 year assets)
- CloudFront edge locations
- 99.9% SLA
- URL: https://hack23.github.io/riksdagsmonitor (via main branch)
- Infrastructure: GitHub Pages
- Benefits:
- Free hosting
- Automatic SSL
- Version control integration
- Disaster recovery
Optimized cache headers for performance:
- HTML files:
max-age=3600, must-revalidate(1 hour) - CSS/JS/Images:
max-age=31536000, immutable(1 year) - Metadata (XML/JSON):
max-age=86400(1 day) - Documentation:
max-age=86400(1 day)
After deployment, CloudFront cache is invalidated (/*) to ensure fresh content.
After a release, verify:
- Release created at https://github.com/Hack23/riksdagsmonitor/releases
- All artifacts uploaded
- Release notes generated
- Attestations available
- Visit https://riksdagsmonitor.com
- Verify application loads
- Check version in footer or version.txt
- Test key functionality
- Visit GitHub Pages URL
- Verify application loads
- Compare with primary deployment
- Visit https://riksdagsmonitor.com/docs/
- Check API documentation
- Review coverage report
- Verify E2E test reports
# Verify build provenance
gh attestation verify riksdagsmonitor-v1.0.0.zip -R Hack23/riksdagsmonitor
# Should output: ✓ Verification succeeded!Symptom: Prepare job fails during build or tests
Common Causes:
- Test failures (unit or E2E)
- Build errors (Vite)
- Missing dependencies
Solution:
- Review workflow logs
- Fix failing tests or build errors
- Test locally:
npm run build && npm test && npm run e2e - Re-trigger release
Symptom: Build job fails during attestation generation
Common Causes:
- Missing OIDC permissions
- Artifact not found
- SBOM generation failure
Solution:
- Verify
id-token: writeandattestations: writepermissions - Check artifact was uploaded correctly
- Review SBOM action logs
Symptom: Release job fails during S3 sync
Common Causes:
- AWS credentials expired
- S3 bucket not accessible
- CloudFront distribution not found
Solution:
- Verify AWS OIDC role configuration
- Check S3 bucket exists and is accessible
- Verify CloudFront distribution ID
Symptom: docs/ directory empty or incomplete
Common Causes:
- JSDoc generation failed
- Coverage report not created
- Test reports missing
Solution:
- Review prepare job logs
- Check for errors in documentation generation steps
- Verify all scripts in package.json are correct
Symptom: Release notes are empty or incorrect
Common Causes:
- .github/release-drafter.yml misconfigured
- Labels missing on PRs
- Release Drafter action failed
Solution:
- Verify .github/release-drafter.yml exists
- Check PR labels match release-drafter.yml categories
- Review Release Drafter action logs
- ✅ Ensure all tests pass locally
- ✅ Review CHANGELOG or recent PRs
- ✅ Update version in package.json (if manual release)
- ✅ Tag commit with descriptive message
- ✅ Notify team of upcoming release
- ✅ Verify deployment on both primary and backup
- ✅ Test key functionality
- ✅ Review documentation
- ✅ Announce release to stakeholders
- ✅ Monitor for issues
- All GitHub Actions pinned to SHA
- Harden-runner enabled
- OIDC authentication for AWS (no long-lived credentials)
- Least privilege permissions
- Attestations generated and verifiable
- SBOM included
- CodeQL scanning passed
- Dependency scanning passed
- Secret scanning passed
Maintained by: Hack23 AB
License: Apache License 2.0
Support: https://github.com/Hack23/riksdagsmonitor/issues