-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (29 loc) · 1.14 KB
/
galaxy_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 }}