mirror of
https://github.com/kewlfft/ansible-aur.git
synced 2025-09-17 00:20:38 +03:00
Update galaxy.yml
improve version handling
This commit is contained in:
14
.github/workflows/galaxy.yml
vendored
14
.github/workflows/galaxy.yml
vendored
@@ -18,15 +18,20 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: collections/ansible_collections/kewlfft/aur
|
path: collections/ansible_collections/kewlfft/aur
|
||||||
|
|
||||||
|
- name: Debug workflow version
|
||||||
|
run: echo "=== RUNNING UPDATED WORKFLOW ==="
|
||||||
|
|
||||||
- name: Verify version in galaxy.yml matches release tag
|
- name: Verify version in galaxy.yml matches release tag
|
||||||
run: |
|
run: |
|
||||||
tag_version="${GITHUB_REF##*/}" # strip refs/tags/
|
tag_version="${GITHUB_REF##*/}" # e.g., v0.12.2
|
||||||
|
tag_version="${tag_version#v}" # strip leading 'v' if present
|
||||||
file_version=$(awk '/^version:/ {print $2}' galaxy.yml)
|
file_version=$(awk '/^version:/ {print $2}' galaxy.yml)
|
||||||
|
|
||||||
if [ "$file_version" != "$tag_version" ]; then
|
if [ "${GITHUB_EVENT_NAME}" != "workflow_dispatch" ] && [ "$file_version" != "$tag_version" ]; then
|
||||||
echo "❌ galaxy.yml version ($file_version) does not match tag ($tag_version)"
|
echo "❌ galaxy.yml version ($file_version) does not match tag ($tag_version)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "✅ Version check passed: $file_version"
|
||||||
|
|
||||||
- name: Build collection
|
- name: Build collection
|
||||||
run: |
|
run: |
|
||||||
@@ -47,6 +52,7 @@ jobs:
|
|||||||
ls -l "$(dirname "$TARBALL")"
|
ls -l "$(dirname "$TARBALL")"
|
||||||
|
|
||||||
- name: Publish collection
|
- name: Publish collection
|
||||||
|
if: github.event_name != 'workflow_dispatch' # skip publish for manual testing
|
||||||
run: |
|
run: |
|
||||||
echo "📤 Publishing $TARBALL ..."
|
echo "📤 Publishing $TARBALL ..."
|
||||||
ansible-galaxy collection publish "$TARBALL" \
|
ansible-galaxy collection publish "$TARBALL" \
|
||||||
|
Reference in New Issue
Block a user