🌱 test minimal mindmap #104
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 Java Project | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'input*' | |
| pull_request: | |
| branches: | |
| - main | |
| - 'input*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Cache Gradle dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: List root directory (debug) | |
| run: ls -l | |
| - name: Make Gradle executable | |
| run: chmod +x ./gradlew | |
| - name: List project directory (debug) | |
| run: ls -l . | |
| - name: Build with Gradle | |
| run: ./gradlew build --parallel --build-cache | |
| - name: List build/libs directory (debug) | |
| run: ls -l build/libs || echo "No JAR built" | |
| - name: Move input and run insert | |
| run: | | |
| ACTOR="${{ github.actor }}" | |
| if [ "$ACTOR" = "arnaudroques" ]; then | |
| ACTOR="[email protected]" | |
| fi | |
| mv input raw | |
| java -jar build/libs/pdiff-all.jar insert -u "$ACTOR" | |
| - name: Setup Git | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "[email protected]" | |
| - name: Create new branch and commit generated files | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| BRANCH_NAME="auto-branch-$(date +'%Y%m%d%H%M%S')" | |
| git checkout -b "$BRANCH_NAME" | |
| git add db/ | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit. Skipping push." | |
| else | |
| git commit -m "Add generated files in /db" | |
| git push origin "$BRANCH_NAME" | |
| fi | |
| - name: Upload JAR Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pdiff-jar | |
| path: build/libs/*.jar |