-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (70 loc) · 2.16 KB
/
Copy pathbuild.yml
File metadata and controls
84 lines (70 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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="plantuml@gmail.com"
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 "github-actions@github.com"
- 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