Build release #50
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Build release | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| tags: | |
| - '*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build release | |
| runs-on: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.SAMLTRACER_BUILD_TOKEN }} | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| # Full git history is needed to get a proper list of changed files within `super-linter` | |
| fetch-depth: 0 | |
| - name: Fetch changes | |
| # Without fetching, we might miss new tags due to caching in Github Actions | |
| run: git fetch --all | |
| - 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 | |
| cp node_modules/pako/dist/pako_inflate.min.mjs 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 | |
| - name: Build zip-file | |
| run: | | |
| zip -1 -r /tmp/samltracer.zip * | |
| - name: Save release | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release | |
| path: "/tmp/samltracer.zip" | |
| retention-days: 1 | |
| - name: Calculate SHA checksum | |
| run: sha256sum "/tmp/samltracer.zip" |