Skip to content

Rename blank.yml to galaxy_build.yml #1

Rename blank.yml to galaxy_build.yml

Rename blank.yml to galaxy_build.yml #1

Workflow file for this run

name: Publish Ansible Galaxy Collection
on:
push:
branches:
- main # Ändern Sie dies entsprechend Ihrem Hauptbranch
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install ansible[galaxy]
- name: Update version in collection.yml
run: |
sed -i 's/version: "[^"]*"/version: "'$(date +%Y%m%d%H%M%S')'"/' collection.yml
- name: Build collection
run: ansible-galaxy collection build -vvv --output-path . --requirements-file requirements.txt --force
env:
ANSIBLE_GALAXY_API_KEY: ${{ secrets.GALAXY_API_KEY }} # Stellen Sie sicher, dass GALAXY_API_KEY in Ihren Secrets gesetzt ist
- name: Publish collection
run: ansible-galaxy collection publish --api-key ${{ secrets.GALAXY_API_KEY }} ./ji_podhead-ilohelper-*.tar.gz
env:
ANSIBLE_GALAXY_API_KEY: ${{ secrets.GALAXY_API_KEY }}