Files
ansible-aur/.github/workflows/galaxy.yml
Mario Finelli c58c59c63d Fix output syntax
A while ago Github deprecated and removed the ::set-output syntax in
favor of appending to the GITHUB_OUTPUT.
2025-08-21 11:18:40 +02:00

44 lines
1.2 KiB
YAML

---
name: Build and Publish Collection to Ansible Galaxy
'on':
release:
types: [ published ]
workflow_dispatch:
defaults:
run:
working-directory: collections/ansible_collections/kewlfft/aur
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout git 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: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: 'pip'
- name: Install pip packages
run: |
pip3 install -U pip
pip3 install wheel
pip3 install ansible-core
- 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"