name: Publish to Galaxy on: workflow_dispatch: inputs: version: description: 'Version to publish (e.g., 1.0.0)' required: true type: string jobs: publish: name: Publish Collection to Ansible Galaxy runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install Ansible run: pip install ansible-core - name: Build collection run: ansible-galaxy collection build - name: Verify build run: | echo "Built collection:" ls -lh valid-nsupdate_zone-*.tar.gz echo "" echo "Contents preview:" tar -tzf valid-nsupdate_zone-*.tar.gz | head -30 - name: Publish to Ansible Galaxy run: | ansible-galaxy collection publish valid-nsupdate_zone-*.tar.gz --token ${{ secrets.GALAXY_API_TOKEN }} if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' env: GALAXY_API_TOKEN: ${{ secrets.GALAXY_API_TOKEN }} - name: Upload collection artifact uses: actions/upload-artifact@v4 with: name: collection-release path: valid-nsupdate_zone-*.tar.gz retention-days: 90