ansible-collection-conference/.forgejo/workflows/ansible-galaxy.yml

50 lines
1.4 KiB
YAML

---
name: Ansible Galaxy
on: # noqa yaml[truthy]
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: docker
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
# Install pipeline dependencies
apt update; apt install --yes python3-pip python3-ruamel.yaml patch
pip3 install --break-system-packages ansible-lint aar-doc
# Install collection dependencies
.forgejo/workflows/requirements.py
ansible-galaxy install -r requirements.yml
rm requirements.yml
- name: Patch aar-doc
run: |
cd /usr/local/lib/python3.*/dist-packages/
patch -p0 < $OLDPWD/.forgejo/workflows/aardoc.patch
- name: Set version in galaxy.yml
run: |
VERSION=${GITHUB_REF#refs/tags/v}
sed -re "s/^version:.*$/version: ${VERSION}/" -i galaxy.yml
- name: Generate metadata, readme and defaults from argument_spec
run: |
set -euo pipefail
for r in roles/*; do
aar-doc --output-mode replace $r markdown
aar-doc --output-mode replace $r defaults
done
- name: Upload collection to Ansible Galaxy
env:
GALAXY_API_KEY: ${{ secrets.GALAXY_API_KEY }}
run: |
ansible-galaxy collection build
ansible-galaxy collection publish --api-key=${GALAXY_API_KEY} s3lph-conference*tar.gz