Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
lib/.gitkeep export-ignore
bin/ export-ignore
Comment thread
tvdijen marked this conversation as resolved.
Outdated
lib/.gitkeep export-ignore
node_modules/ export-ignore
composer.lock export-ignore
53 changes: 45 additions & 8 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ jobs:
runs-on: [ubuntu-latest]

steps:
- uses: actions/setup-node@v4
with:
node-version: 20

- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
token: ${{ secrets.SAMLTRACER_BUILD_TOKEN }}
ref: ${{ github.head_ref || github.ref_name }}
Expand All @@ -29,17 +25,58 @@ jobs:
# Without fetching, we might miss new tags due to caching in Github Actions
run: git fetch --all

- name: Run build-script
run: bin/build.sh
- uses: actions/setup-node@v6
with:
node-version: 24

- name: Install & build assets
run: |
# Make sure the lock-file is up to date before we run clean-install
npm install --package-lock-only
npm clean-install
npm audit fix

# Store the version, stripping any v-prefix
- name: Write release version
run: |
TAG="${{ github.ref_name }}"
echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"

- name: Setup PHP, with composer and extensions
id: setup-php
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
# Should match the minimum required version for SimpleSAMLphp
php-version: '8.5'
tools: composer:v2
coverage: none

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install Composer dependencies
run: composer install --no-progress --no-dev --prefer-dist --optimize-autoloader

- name: Copy third-party dependencies to lib/ directory
run: |
cp vendor/fredericpetit/highlightjs-composer/assets/js/highlight.min.js lib/highlight.min.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formerly we had this in build.sh which, I think, leads to a much smaller result:
node tools/build.js xml properties http

This highlight.min.js has all grammars included which really boosts the file size. But I guess we'll just have to accept that...

@tvdijen tvdijen Jul 6, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a way to do this without including the full version with all gramars.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m sorry, I didn’t express myself clearly here:
What I wanted to say is - we won't get around using the much larger full min.js. Not for technical reasons, but to be compliant.

Why? Put yourself in the reviewer’s shoes: Well, there's this "highlight.js": "github:highlightjs/highlight.js" line in the package.json, but the resulting file's (node tools/build.js xml properties http) SHA-256 checksum is EDC54457F239E23A9FE14DA9C5ECF5B6B0F703DF385C072D669B8D9D140EA565.

If the reviewer doesn't build this same custom hljs version (what they probably won't do), then there'll never be the same file hash.

Consequently, from the reviewer’s perspective, it will appear as though we are saying we are using the official hljs, but what we are actually delivering is a minified, custom version of hljs, which they cannot really verify.

cp node_modules/pako/dist/pako_inflate.min.js lib/pako_inflate.min.js

- name: Clean release
run: |
grep export-ignore .gitattributes | cut -d ' ' -f 1 | while IFS= read -r line
do
rm -rf "$line"
done
rm -rf .git
Comment thread
tvdijen marked this conversation as resolved.

- name: Build zip-file
run: |
zip -1 -r /tmp/samltracer.zip *

- name: Save release
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: release
path: "/tmp/samltracer.zip"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: 20
node-version: 26

- name: Install dependencies
run: npm ci
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
lib/*.js
node_modules/
vendor/
composer.lock
485 changes: 459 additions & 26 deletions LICENSE
Comment thread
tvdijen marked this conversation as resolved.

Large diffs are not rendered by default.

68 changes: 0 additions & 68 deletions bin/build.sh

This file was deleted.

8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "simplesamlphp/saml-tracer",
"description": "A debugger for viewing SAML messages",
"license": "LGPL-2.1-or-later",
"require": {
"fredericpetit/highlightjs-composer": "^11.11"
}
}
Loading