Skip to content

Commit 68ec47f

Browse files
committed
Update ci.yml
1 parent 6e2c2fb commit 68ec47f

File tree

1 file changed

+1
-79
lines changed

1 file changed

+1
-79
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -108,90 +108,13 @@ jobs:
108108
--no-max-string-line-length --no-max-comment-line-length
109109
working-directory: modules
110110
111-
bump-version:
112-
needs: linter
113-
runs-on: ubuntu-latest
114-
outputs:
115-
sha: ${{ steps.sha.outputs.sha }}
116-
steps:
117-
- uses: actions/checkout@v3
118-
with:
119-
fetch-depth: 0
120-
- name: bump-version
121-
shell: bash
122-
run: |
123-
set -euo pipefail
124-
base="${{ github.event.before }}"
125-
changed_dirs=$(git diff --name-only "$base" "$GITHUB_SHA" | awk -F/ '{print $1}' | sort -u)
126-
for dir in $changed_dirs; do
127-
file="$dir/module.lua"
128-
[ -f "$file" ] || continue
129-
130-
# Check if changes are only in docs folders
131-
dir_changes=$(git diff --name-only "$base" "$GITHUB_SHA" | grep "^$dir/" || true)
132-
only_docs=true
133-
for change in $dir_changes; do
134-
# Check if this change is NOT a documentation-only change
135-
if [[ "$change" != "$dir/README.md" ]] && \
136-
[[ "$change" != "$dir/readme.md" ]] && \
137-
[[ "$change" != "$dir/module.lua" ]] && \
138-
[[ ! "$change" =~ ^$dir/docs/ ]] && \
139-
[[ ! "$change" =~ ^$dir/[^/]*\.md$ ]]; then
140-
only_docs=false
141-
break
142-
fi
143-
done
144-
145-
# Skip version bump if only docs changes
146-
if [ "$only_docs" = true ]; then
147-
echo "Skipping version bump for $dir - only docs changes detected"
148-
continue
149-
fi
150-
151-
v=$(grep -Eo 'MODULE\.version\s*=\s*[0-9]+(\.[0-9]{2})?' "$file" | awk -F= '{print $2}' | tr -d '[:space:]')
152-
[ -z "$v" ] && v="1.00"
153-
if [[ $v == *.* ]]; then
154-
major="${v%%.*}"
155-
minor="${v##*.}"
156-
else
157-
major="$v"
158-
minor="00"
159-
fi
160-
minor=$((10#$minor + 1))
161-
if [ "$minor" -eq 100 ]; then
162-
minor=0
163-
major=$((major + 1))
164-
fi
165-
if [ "$minor" -eq 0 ]; then
166-
new_ver="$major"
167-
else
168-
new_ver=$(printf "%d.%02d" "$major" "$minor")
169-
fi
170-
if grep -q 'MODULE\.version' "$file"; then
171-
sed -i -E "s/(MODULE\.version\s*=\s*)[0-9]+(\.[0-9]{2})?/\1$new_ver/" "$file"
172-
else
173-
printf '\nMODULE.version = %s\n' "$new_ver" >> "$file"
174-
fi
175-
git add "$file"
176-
done
177-
if ! git diff --cached --quiet; then
178-
git config user.email "githubactions@github.com"
179-
git config user.name "GitHub Actions"
180-
git commit -m "Updated Modules Versions"
181-
git push origin HEAD:main
182-
fi
183-
- name: record-sha
184-
id: sha
185-
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
186-
187111
scrape-modules:
188-
needs: bump-version
112+
needs: linter
189113
runs-on: ubuntu-latest
190114
steps:
191115
- uses: actions/checkout@v3
192116
with:
193117
fetch-depth: 0
194-
ref: ${{ needs.bump-version.outputs.sha }}
195118
- run: sudo apt-get update && sudo apt-get install -y jq zip
196119
- name: extract-module-metadata
197120
shell: bash
@@ -277,7 +200,6 @@ jobs:
277200
- uses: actions/checkout@v3
278201
with:
279202
fetch-depth: 0
280-
ref: ${{ needs.bump-version.outputs.sha }}
281203
- name: create-docs-dir
282204
run: mkdir -p documentation
283205
- uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)