mirror of
https://github.com/kewlfft/ansible-aur.git
synced 2025-09-17 08:30:39 +03:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7affd00193 | ||
![]() |
8e6f0f49bd | ||
![]() |
bb73f524ca | ||
![]() |
62193e882c | ||
![]() |
290b852836 | ||
![]() |
31828edaf9 | ||
![]() |
610e14b8c2 | ||
![]() |
b8da3380f5 | ||
![]() |
984cb9fde1 | ||
![]() |
0d4d6aa3e7 | ||
![]() |
d2f3fb5802 | ||
![]() |
3ec32e68a3 |
52
.github/workflows/galaxy.yml
vendored
52
.github/workflows/galaxy.yml
vendored
@@ -1,9 +1,8 @@
|
||||
---
|
||||
name: Build and Publish Collection to Ansible Galaxy
|
||||
|
||||
'on':
|
||||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
defaults:
|
||||
@@ -14,18 +13,47 @@ jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout git repo
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
path: collections/ansible_collections/kewlfft/aur
|
||||
|
||||
- name: Ensure that `version:` in `galaxy.yml` matches `GITHUB_REF`
|
||||
id: version
|
||||
run: |
|
||||
[ "$(cat galaxy.yml | grep version: | awk '{print $2}')" = $(awk -F '/' '{print substr($3, 2)}' <<< ${GITHUB_REF}) ] || exit 1
|
||||
echo "version=$(awk -F '/' '{print substr($3, 2)}' <<< ${GITHUB_REF})" >> $GITHUB_OUTPUT
|
||||
- name: Debug workflow version
|
||||
run: echo "=== RUNNING UPDATED WORKFLOW ==="
|
||||
|
||||
- name: Deploy collection
|
||||
- name: Verify version in galaxy.yml matches release tag
|
||||
run: |
|
||||
ansible-galaxy collection build
|
||||
ansible-galaxy collection publish --api-key ${{ secrets.GALAXY_API_KEY }} "./kewlfft-aur-${{ steps.version.outputs.version }}.tar.gz"
|
||||
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)
|
||||
|
||||
if [ "${GITHUB_EVENT_NAME}" != "workflow_dispatch" ] && [ "$file_version" != "$tag_version" ]; then
|
||||
echo "❌ galaxy.yml version ($file_version) does not match tag ($tag_version)"
|
||||
exit 1
|
||||
fi
|
||||
echo "✅ Version check passed: $file_version"
|
||||
|
||||
- name: Build collection
|
||||
run: |
|
||||
path=$(ansible-galaxy collection build | awk '/Created collection/ {print $NF}')
|
||||
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
|
||||
if: github.event_name != 'workflow_dispatch' # skip publish for manual testing
|
||||
run: |
|
||||
echo "📤 Publishing $TARBALL ..."
|
||||
ansible-galaxy collection publish "$TARBALL" \
|
||||
--api-key "${{ secrets.ANSIBLE_GALAXY_API_KEY }}"
|
||||
|
@@ -8,7 +8,7 @@ namespace: kewlfft
|
||||
name: aur
|
||||
|
||||
# The version of the collection. Must be compatible with semantic versioning
|
||||
version: 0.12.1
|
||||
version: 0.13.0
|
||||
|
||||
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
|
||||
readme: README.md
|
||||
|
Reference in New Issue
Block a user