-
Notifications
You must be signed in to change notification settings - Fork 10
36 lines (34 loc) · 1.02 KB
/
release_galaxy.yaml
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: Ansible Galaxy release
"on":
workflow_call:
inputs:
environment:
description: The deployment environment
required: true
type: string
galaxy_publish:
default: true
description: Publish the collection on galaxy
type: boolean
secrets:
ansible_galaxy_api_key:
required: false
jobs:
release:
runs-on: ubuntu-latest
name: Galaxy release
environment: "${{ inputs.environment }}"
steps:
- uses: actions/checkout@v4
- name: Build the collection
run: |
ansible-galaxy collection build -v --force
- name: Publish the collection on Galaxy
if: "${{ inputs.galaxy_publish }}"
run: >
[[ "${{ secrets.ansible_galaxy_api_key != '' }}" ]] || { echo
"ansible_galaxy_api_key is required to publish on galaxy" ; exit 1; }
TARBALL=$(ls -1 ./*.tar.gz)
ansible-galaxy collection publish "${TARBALL}" --api-key "${{
secrets.ansible_galaxy_api_key }}"