8 Commits

Author SHA1 Message Date
kewl
290b852836 Update galaxy.yml
bump version
2025-08-22 21:13:35 +01:00
kewl
31828edaf9 Update galaxy.yml
add log
2025-08-22 20:53:45 +01:00
kewl
610e14b8c2 Update galaxy.yml
fix path
2025-08-22 20:51:19 +01:00
kewl
b8da3380f5 Update galaxy.yml
fixed path
2025-08-22 20:49:26 +01:00
kewl
984cb9fde1 Update galaxy.yml
finds tarball
2025-08-22 20:47:01 +01:00
kewl
0d4d6aa3e7 Update galaxy.yml
fix publish
2025-08-22 20:44:24 +01:00
kewl
d2f3fb5802 Update galaxy.yml
fixed deployment and improve version check
2025-08-22 20:41:09 +01:00
kewl
3ec32e68a3 Update galaxy.yml
updated key name
2025-08-22 20:31:43 +01:00
2 changed files with 34 additions and 12 deletions

View File

@@ -1,7 +1,6 @@
---
name: Build and Publish Collection to Ansible Galaxy name: Build and Publish Collection to Ansible Galaxy
'on': on:
release: release:
types: [published] types: [published]
workflow_dispatch: workflow_dispatch:
@@ -14,18 +13,41 @@ jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout git repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v5
with: with:
path: collections/ansible_collections/kewlfft/aur path: collections/ansible_collections/kewlfft/aur
- name: Ensure that `version:` in `galaxy.yml` matches `GITHUB_REF` - name: Verify version in galaxy.yml matches release tag
id: version
run: | run: |
[ "$(cat galaxy.yml | grep version: | awk '{print $2}')" = $(awk -F '/' '{print substr($3, 2)}' <<< ${GITHUB_REF}) ] || exit 1 tag_version="${GITHUB_REF##*/}" # strip refs/tags/
echo "version=$(awk -F '/' '{print substr($3, 2)}' <<< ${GITHUB_REF})" >> $GITHUB_OUTPUT file_version=$(awk '/^version:/ {print $2}' galaxy.yml)
- name: Deploy collection if [ "$file_version" != "$tag_version" ]; then
echo "❌ galaxy.yml version ($file_version) does not match tag ($tag_version)"
exit 1
fi
- name: Build collection
run: | run: |
ansible-galaxy collection build path=$(ansible-galaxy collection build | awk '/Created collection/ {print $NF}')
ansible-galaxy collection publish --api-key ${{ secrets.GALAXY_API_KEY }} "./kewlfft-aur-${{ steps.version.outputs.version }}.tar.gz" echo "TARBALL=$path" >> $GITHUB_ENV
echo "📦 Built collection at $path"
- name: Upload built collection artifact
uses: actions/upload-artifact@v4
with:
name: ansible-collection-tarball
path: ${{ env.TARBALL }}
- name: Debug tarball before publish
run: |
echo "🔎 Checking tarball path..."
echo "TARBALL=$TARBALL"
ls -l "$(dirname "$TARBALL")"
- name: Publish collection
run: |
echo "📤 Publishing $TARBALL ..."
ansible-galaxy collection publish "$TARBALL" \
--api-key "${{ secrets.ANSIBLE_GALAXY_API_KEY }}"

View File

@@ -8,7 +8,7 @@ namespace: kewlfft
name: aur name: aur
# The version of the collection. Must be compatible with semantic versioning # The version of the collection. Must be compatible with semantic versioning
version: 0.12.1 version: 0.12.2
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection # The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md readme: README.md