ansible-keycloak/.github/workflows/release.yml

54 lines
1.6 KiB
YAML
Raw Normal View History

---
2021-12-14 08:54:49 +00:00
name: Release collection
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
2021-12-14 08:54:49 +00:00
jobs:
release:
runs-on: ubuntu-latest
steps:
2022-01-27 10:59:10 +00:00
- name: Checkout code
uses: actions/checkout@v2
2021-12-14 08:54:49 +00:00
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"
- name: Get Tag Version
id: get_version
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/tags/}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible-core
- name: Build collection
run: |
ansible-galaxy collection build .
- name: Publish Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: "*.tar.gz"
body: "Release v${{ steps.get_version.outputs.TAG_VERSION }}"
2021-12-14 08:54:49 +00:00
- name: Publish collection
env:
ANSIBLE_GALAXY_API_KEY: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
run: |
2022-01-27 10:59:10 +00:00
ansible-galaxy collection publish *.tar.gz --api-key $ANSIBLE_GALAXY_API_KEY
dispatch:
2022-01-27 10:59:10 +00:00
needs: release
strategy:
matrix:
repo: ['ansible-middleware/cross-dc-rhsso-demo', 'ansible-middleware/flange-demo']
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.TRIGGERING_PAT }}
repository: ${{ matrix.repo }}
event-type: "Dependency released - Keycloak"
client-payload: '{ "github": ${{toJson(github)}} }'