33 lines
888 B
YAML
33 lines
888 B
YAML
name: publish-to-ansible-galaxy
|
|
on:
|
|
release:
|
|
types: [published]
|
|
jobs:
|
|
update-version-and-publish:
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: main
|
|
token: ${{ secrets.DEVOPS_BOT_PAT }}
|
|
|
|
- name: Update version
|
|
run: |
|
|
echo "Updating version"
|
|
sed -i "s/version: .*/version: ${{ github.event.release.tag_name }}/g" galaxy.yml
|
|
|
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
commit_message: "Update galaxy.yml version to ${{ github.event.release.tag_name }}"
|
|
branch: "main"
|
|
file_pattern: "galaxy.yml"
|
|
push_options: --force
|
|
|
|
- uses: ansible/ansible-publish-action@v1.0.0
|
|
with:
|
|
api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
|
|
api_server: https://galaxy.ansible.com/api/
|
|
src_path: .
|