Skip to content

Commit 4bbff4d

Browse files
authored
Update r.yml
1 parent 5793e43 commit 4bbff4d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/r.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
id: ver
2121
run: |
2222
SHORT=$(git rev-parse --short HEAD)
23+
# versionCode = total number of commits
2324
CODE=$(git rev-list --count HEAD)
25+
# bump minor version from current module.prop major
2426
MAJOR=$(grep '^version=' module.prop | sed 's/version=\([0-9]*\).*/\1/')
2527
VERSION="${MAJOR}.$(( CODE )) (${CODE}-${SHORT}-release)"
2628
TAG="v${MAJOR}.${CODE}-${SHORT}"
@@ -31,8 +33,10 @@ jobs:
3133
3234
- name: Generate sha256 files
3335
run: |
36+
# Find all files except .sha256, .git, and update.Json (which changes post-build)
3437
find . \
3538
-not -path './.git/*' \
39+
-not -path './.github/*' \
3640
-not -name '*.sha256' \
3741
-not -name 'update.Json' \
3842
-type f | while read -r f; do
@@ -48,6 +52,7 @@ jobs:
4852
id: zip
4953
run: |
5054
ZIPNAME="YetAnotherBootloopProtector-${{ steps.ver.outputs.code }}-${{ steps.ver.outputs.tag }}.zip"
55+
# Exclude .git, update.Json (updated separately after release), and README
5156
zip -r "$ZIPNAME" . \
5257
-x '.git/*' \
5358
-x '.github/*' -x '.github/**/*' \
@@ -80,6 +85,11 @@ jobs:
8085
run: |
8186
git config user.name "github-actions[bot]"
8287
git config user.email "github-actions[bot]@users.noreply.github.com"
83-
git add '*.sha256' '*/*.sha256' '*/*/*.sha256' '*/*/*/*.sha256' module.prop update.Json
88+
# Stage everything: sha256 files, module.prop, update.Json
89+
git add module.prop update.Json
90+
git add $(git ls-files --others --exclude-standard | grep '\.sha256
8491
git commit -m "chore: release ${{ steps.ver.outputs.tag }} [skip ci]"
85-
git push
92+
git push
93+
| grep -v '^\.github/')
94+
git commit -m "chore: release ${{ steps.ver.outputs.tag }} [skip ci]"
95+
git push

0 commit comments

Comments
 (0)