-
-
Notifications
You must be signed in to change notification settings - Fork 20
31 lines (29 loc) · 1020 Bytes
/
publish.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
name: Publish
on:
release:
types: [published]
jobs:
publish:
name: Publish collection to Ansible Galaxy
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
- name: Get the version name from the tags
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Change collection version to match tag
run: |
sed -Ei "s/^version: .*/version: ${{ env.RELEASE_VERSION }}/" galaxy.yml
- name: Commit galaxy.yml
uses: stefanzweifel/[email protected]
with:
branch: main
commit_message: "Update galaxy.yml for ${{ env.RELEASE_VERSION }}"
file_pattern: galaxy.yml
- name: Publish collection
uses: docker://ghcr.io/artis3n/ansible_galaxy_collection:v2.9.0
with:
api_key: '${{ secrets.ANSIBLE_GALAXY_API_KEY }}'
galaxy_version: '${{ env.RELEASE_VERSION }}'