mirror of
https://github.com/kewlfft/ansible-aur.git
synced 2025-09-17 08:30:39 +03:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
290b852836 | ||
![]() |
31828edaf9 | ||
![]() |
610e14b8c2 | ||
![]() |
b8da3380f5 | ||
![]() |
984cb9fde1 | ||
![]() |
0d4d6aa3e7 | ||
![]() |
d2f3fb5802 | ||
![]() |
3ec32e68a3 | ||
![]() |
37d4b45acd | ||
![]() |
ebb5e9aed1 | ||
![]() |
2ef95d29d6 | ||
![]() |
c58c59c63d | ||
![]() |
b2ed7c1dc6 | ||
![]() |
a2267b88a3 |
64
.github/workflows/galaxy.yml
vendored
64
.github/workflows/galaxy.yml
vendored
@@ -1,9 +1,8 @@
|
|||||||
---
|
|
||||||
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:
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@@ -12,44 +11,43 @@ defaults:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout git repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
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 ::set-output name=version::$(awk -F '/' '{print substr($3, 2)}' <<< ${GITHUB_REF})
|
file_version=$(awk '/^version:/ {print $2}' galaxy.yml)
|
||||||
|
|
||||||
- name: "Set up Python"
|
if [ "$file_version" != "$tag_version" ]; then
|
||||||
uses: actions/setup-python@v2
|
echo "❌ galaxy.yml version ($file_version) does not match tag ($tag_version)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- 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:
|
with:
|
||||||
python-version: "3.11"
|
name: ansible-collection-tarball
|
||||||
|
path: ${{ env.TARBALL }}
|
||||||
|
|
||||||
- name: Generate cache keys
|
- name: Debug tarball before publish
|
||||||
id: keys
|
|
||||||
run: |
|
run: |
|
||||||
echo ::set-output name=pip_cache_dir::$(pip cache dir)
|
echo "🔎 Checking tarball path..."
|
||||||
# This ensures that the cache is invalidated after a week
|
echo "TARBALL=$TARBALL"
|
||||||
echo ::set-output name=date::$(date +%Y_%g)
|
ls -l "$(dirname "$TARBALL")"
|
||||||
|
|
||||||
- name: Pip Cache
|
- name: Publish collection
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.keys.outputs.pip_cache_dir }}
|
|
||||||
key: ansible-pip-${{ steps.keys.outputs.date }}
|
|
||||||
|
|
||||||
- name: Install pip packages
|
|
||||||
run: |
|
run: |
|
||||||
pip3 install -U pip
|
echo "📤 Publishing $TARBALL ..."
|
||||||
pip3 install wheel
|
ansible-galaxy collection publish "$TARBALL" \
|
||||||
pip3 install ansible-core
|
--api-key "${{ secrets.ANSIBLE_GALAXY_API_KEY }}"
|
||||||
|
|
||||||
- name: Deploy collection
|
|
||||||
run: |
|
|
||||||
ansible-galaxy collection build
|
|
||||||
ansible-galaxy collection publish --api-key ${{ secrets.GALAXY_API_KEY }} "./kewlfft-aur-${{ steps.version.outputs.version }}.tar.gz"
|
|
||||||
|
@@ -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.0
|
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
|
||||||
|
Reference in New Issue
Block a user