-
-
Notifications
You must be signed in to change notification settings - Fork 17
31 lines (29 loc) · 1.15 KB
/
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/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
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.10.1@sha256:512e8de7c7bb22e53ceadef302a2b181045895fa468540761d4ab1e7247ba68c
with:
api_key: '${{ secrets.ANSIBLE_GALAXY_API_KEY }}'
galaxy_version: '${{ env.RELEASE_VERSION }}'