fix(runtime): enforce deterministic LF generation #128
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: snapshot | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to build snapshot from' | |
| required: true | |
| default: master | |
| push: | |
| branches: [master, 'v[0-9]*'] | |
| concurrency: | |
| group: publish-ghpages-${{ github.repository }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.event.inputs.branch || github.ref }} | |
| fetch-depth: 0 | |
| - name: Check LF line endings | |
| run: bash .github/scripts/check-line-endings.sh | |
| - name: Set snapshot SHA | |
| id: snapshot | |
| run: echo "sha=$(git rev-parse --short=8 HEAD)" >> "$GITHUB_OUTPUT" | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Log tool versions | |
| run: | | |
| java --version | |
| mvn --version | |
| - name: Cache Maven dependencies | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-publish-${{ hashFiles('**/pom.xml', '**/*.target') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven-publish- | |
| ${{ runner.os }}-maven-0- | |
| - name: Drop cached p2 metadata for the DDK update site | |
| # The restored blob persists Tycho's HTTP cache (~/.m2/repository/.cache/tycho). | |
| # Tycho's cache-first transport never revalidates cached 404/301 entries, and | |
| # p2/releases/latest + p2/snapshots/latest are moving pointers, so a stale blob | |
| # silently disables the compare-version-with-baselines gate (the mojo has no | |
| # "baseline not found" branch and passes vacuously). Deleting only the DDK hosts | |
| # forces a fresh metadata fetch (a few KB) while keeping eclipse.org metadata and | |
| # all downloaded artifacts cached. It also keeps the blob this job saves clean | |
| # for the verify.yml consumers. | |
| run: rm -rf ~/.m2/repository/.cache/tycho/https/dsldevkit.github.io ~/.m2/repository/.cache/tycho/https/ddk.tools.avaloq.com | |
| - name: Build p2 update site | |
| run: | | |
| xvfb-run mvn clean verify \ | |
| checkstyle:check pmd:pmd pmd:cpd pmd:check pmd:cpd-check spotbugs:check \ | |
| -f ./ddk-parent/pom.xml \ | |
| --batch-mode --fail-at-end | |
| - name: Fail on missing surefire reports | |
| if: always() | |
| run: bash .github/scripts/check-surefire-reports.sh | |
| - name: Archive test logs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: test-logs-${{ github.sha }} | |
| path: com.avaloq.tools.ddk.xtext.test/target/work/data/.metadata/.log | |
| - name: Upload p2 update site as artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: p2-update-site-${{ github.sha }} | |
| path: ddk-repository/target/repository/ | |
| retention-days: 30 | |
| - name: Check out gh-pages branch | |
| id: checkout-gh-pages | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| fetch-depth: 1 | |
| continue-on-error: true | |
| - name: Bootstrap gh-pages branch if missing | |
| if: steps.checkout-gh-pages.outcome != 'success' | |
| run: | | |
| rm -rf gh-pages | |
| mkdir gh-pages | |
| cd gh-pages | |
| git init -b gh-pages | |
| touch .nojekyll | |
| git remote add origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish p2 snapshot to gh-pages | |
| run: bash .github/scripts/publish-p2-ghpages.sh | |
| env: | |
| SNAPSHOT_SHA: ${{ steps.snapshot.outputs.sha }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Clean up old p2 snapshots | |
| run: bash .github/scripts/cleanup-p2-snapshots.sh | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Snapshot workflow: | |
| # Triggered on every push to master or v[0-9]* branches | |
| # Builds, deploys to p2/snapshots/<sha8>/, keeps last 20 | |
| # See release.yml for promoting a snapshot to a release |