Update galaxy.yml

improve version check
This commit is contained in:
kewl
2025-08-22 21:18:17 +01:00
committed by GitHub
parent 290b852836
commit 62193e882c

View File

@@ -1,70 +1,59 @@
### REQUIRED name: Build and Publish Collection to Ansible Galaxy
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
# underscores or numbers and cannot contain consecutive underscores
namespace: kewlfft
# The name of the collection. Has the same character restrictions as 'namespace' on:
name: aur release:
types: [published]
workflow_dispatch:
# The version of the collection. Must be compatible with semantic versioning defaults:
version: 0.12.2 run:
working-directory: collections/ansible_collections/kewlfft/aur
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection jobs:
readme: README.md release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v5
with:
path: collections/ansible_collections/kewlfft/aur
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url) - name: Debug workflow version
# @nicks:irc/im.site#channel' run: echo "=== RUNNING UPDATED WORKFLOW ==="
authors:
- kewl fft <kewl@alto.eu.org>
- name: Verify version in galaxy.yml matches release tag
run: |
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)
### OPTIONAL but strongly recommended if [ "${GITHUB_EVENT_NAME}" != "workflow_dispatch" ] && [ "$file_version" != "$tag_version" ]; then
# A short summary description of the collection echo "❌ galaxy.yml version ($file_version) does not match tag ($tag_version)"
description: This collection includes an Ansible module to manage packages from the AUR. exit 1
fi
echo "✅ Version check passed: $file_version"
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only - name: Build collection
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file' run: |
license: path=$(ansible-galaxy collection build | awk '/Created collection/ {print $NF}')
- GPL-3.0-or-later echo "TARBALL=$path" >> $GITHUB_ENV
echo "📦 Built collection at $path"
# The path to the license file for the collection. This path is relative to the root of the collection. This key is - name: Upload built collection artifact
# mutually exclusive with 'license' uses: actions/upload-artifact@v4
license_file: '' with:
name: ansible-collection-tarball
path: ${{ env.TARBALL }}
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character - name: Debug tarball before publish
# requirements as 'namespace' and 'name' run: |
tags: echo "🔎 Checking tarball path..."
- aur echo "TARBALL=$TARBALL"
- arch_user_repository ls -l "$(dirname "$TARBALL")"
- arch
- archlinux
- arch_linux
- packaging
- software
# Collections that this collection requires to be installed for it to be usable. The key of the dict is the - name: Publish collection
# collection label 'namespace.name'. The value is a version range if: github.event_name != 'workflow_dispatch' # skip publish for manual testing
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version run: |
# range specifiers can be set and are separated by ',' echo "📤 Publishing $TARBALL ..."
dependencies: {} ansible-galaxy collection publish "$TARBALL" \
--api-key "${{ secrets.ANSIBLE_GALAXY_API_KEY }}"
# The URL of the originating SCM repository
repository: https://github.com/kewlfft/ansible-aur
# The URL to any online docs
documentation: https://github.com/kewlfft/ansible-aur/blob/master/README.md
# The URL to the homepage of the collection/project
homepage: https://github.com/kewlfft/ansible-aur
# The URL to the collection issue tracker
issues: https://github.com/kewlfft/ansible-aur/issues
# A list of file glob-like patterns used to filter any files or directories that should not be included in the build
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
# and '.git' are always filtered
build_ignore:
- .github
- .gitignore