Skip to content

Commit ef5bf1f

Browse files
authored
Back to simpler yaml
1 parent 6a07a8c commit ef5bf1f

File tree

1 file changed

+6
-64
lines changed

1 file changed

+6
-64
lines changed

.github/workflows/build-extensions.yml

Lines changed: 6 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -19,81 +19,23 @@ jobs:
1919
with:
2020
python-version: '3.11'
2121

22-
- name: Store checksums of existing files
23-
run: |
24-
mkdir -p /tmp/checksums
25-
if [ -d "extensions/tapp" ]; then
26-
for file in extensions/tapp/*.tapp; do
27-
if [ -f "$file" ]; then
28-
sha256sum "$file" > "/tmp/checksums/$(basename "$file").sha256"
29-
fi
30-
done
31-
fi
32-
if [ -f "extensions/extensions.jsonl" ]; then
33-
sha256sum "extensions/extensions.jsonl" > "/tmp/checksums/extensions.jsonl.sha256"
34-
fi
35-
3622
- name: Run gen.py to build extensions
3723
run: |
3824
python3 gen.py
3925
40-
- name: Check for actual changes and commit
26+
- name: Commit generated files
4127
run: |
4228
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
4329
git config user.name "github-actions[bot]"
44-
45-
changed_files=""
46-
47-
# Check extensions.jsonl
48-
if [ -f "/tmp/checksums/extensions.jsonl.sha256" ] && [ -f "extensions/extensions.jsonl" ]; then
49-
old_checksum=$(cat /tmp/checksums/extensions.jsonl.sha256 | cut -d' ' -f1)
50-
new_checksum=$(sha256sum extensions/extensions.jsonl | cut -d' ' -f1)
51-
if [ "$old_checksum" = "$new_checksum" ]; then
52-
echo "extensions.jsonl unchanged"
53-
else
54-
echo "extensions.jsonl changed"
55-
git add extensions/extensions.jsonl
56-
changed_files="$changed_files extensions/extensions.jsonl"
57-
fi
58-
elif [ -f "extensions/extensions.jsonl" ]; then
59-
echo "extensions.jsonl is new"
60-
git add extensions/extensions.jsonl
61-
changed_files="$changed_files extensions/extensions.jsonl"
62-
fi
63-
64-
# Check each .tapp file
65-
for tapp_file in extensions/tapp/*.tapp; do
66-
if [ -f "$tapp_file" ]; then
67-
filename=$(basename "$tapp_file")
68-
if [ -f "/tmp/checksums/$filename.sha256" ]; then
69-
old_checksum=$(cat "/tmp/checksums/$filename.sha256" | cut -d' ' -f1)
70-
new_checksum=$(sha256sum "$tapp_file" | cut -d' ' -f1)
71-
if [ "$old_checksum" = "$new_checksum" ]; then
72-
echo "$filename unchanged"
73-
else
74-
echo "$filename changed"
75-
git add "$tapp_file"
76-
changed_files="$changed_files $tapp_file"
77-
fi
78-
else
79-
echo "$filename is new"
80-
git add "$tapp_file"
81-
changed_files="$changed_files $tapp_file"
82-
fi
83-
fi
84-
done
85-
86-
# Only commit if there are actual changes
87-
if [ -n "$changed_files" ]; then
88-
echo "Committing changed files:$changed_files"
89-
git commit -m "Auto-build extensions from raw/ changes - ${GITHUB_SHA}"
90-
else
91-
echo "No files changed, skipping commit"
30+
git add extensions/tapp/ extensions/extensions.jsonl
31+
if git diff --staged --quiet; then
32+
echo "No changes to commit"
9233
exit 0
9334
fi
35+
git commit -m "Auto-build extensions from raw/ changes - ${GITHUB_SHA}"
9436
9537
- name: Push changes to repository
9638
uses: ad-m/github-push-action@master
9739
with:
9840
github_token: ${{ secrets.GITHUB_TOKEN }}
99-
branch: 'main'
41+
branch: 'main'

0 commit comments

Comments
 (0)