-
Notifications
You must be signed in to change notification settings - Fork 43
Feature/refactor build #110
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
Changes from 6 commits
1d4c047
7e40cb8
b468f88
4db06f4
dee6bad
96623a0
e561dfe
4c9c17f
835480f
0367552
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| lib/.gitkeep export-ignore | ||
| bin/ export-ignore | ||
| lib/.gitkeep export-ignore | ||
| node_modules/ export-ignore | ||
| composer.lock export-ignore | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 }} | ||
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: This highlight.min.js has all grammars included which really boosts the file size. But I guess we'll just have to accept that...
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m sorry, I didn’t express myself clearly here: Why? Put yourself in the reviewer’s shoes: Well, there's this 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 | ||
|
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" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| lib/*.js | ||
| node_modules/ | ||
| vendor/ | ||
| composer.lock |
|
tvdijen marked this conversation as resolved.
|
Large diffs are not rendered by default.
This file was deleted.
| 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" | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.