-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 895 Bytes
/
release.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
name: Release
on:
workflow_dispatch:
push:
tags:
- 'v*'
env:
GALAXY_USERNAME: micxer
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Ansible.
run: pip3 install ansible-core
# Galaxy uses CamelCase username but GitHub is all lowercase
# This concatenates the versions together to work with
# And triggers an import on Galaxy
- name: Trigger a new import on Galaxy.
run: |
REPO="$(echo ${{ github.repository }} | cut -d/ -f2)"
ROLE_NAME="$(echo "${REPO#ansible-role-}" | tr '-' '_')"
ansible-galaxy role import --token ${{ secrets.GALAXY_API_KEY }} \
--branch main --role-name $ROLE_NAME \
${{ env.GALAXY_USERNAME }} $REPO