Publish #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to publish (e.g. v1.2.3)' | |
required: true | |
test: | |
description: 'Whether to run tests or not' | |
required: true | |
default: 'yes' | |
ansible-repo: | |
required: true | |
description: 'Ansible repo to publish the Module to (galaxy or galaxy-dev)' | |
default: 'galaxy-dev' | |
jobs: | |
call-ci-workflow: | |
uses: ./.github/workflows/CI.yml | |
if: github.event.inputs.test == 'yes' | |
secrets: inherit | |
publish: | |
name: Publishing the Module | |
runs-on: ubuntu-latest | |
# needs: [call-ci-workflow] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: master | |
- name: Get current version | |
id: cversion | |
run: echo "::set-output name=version::$(grep version galaxy.yml | awk -F':' '{ print $2 }')" | |
- name: Build Ansible Collection | |
run: | | |
ansible-galaxy collection build | |
- name: Deploy Ansible collection to Galaxy-Dev | |
if: github.event.inputs.ansible-repo == 'galaxy-dev' | |
run: | | |
ls | |
ansible-galaxy collection publish ionoscloudsdk-ionoscloud-${{ github.event.inputs.version }}.tar.gz --server https://galaxy-dev.ansible.com/ --api-key ${{ secrets.ANSIBLE_GALAXYDEV_API_KEY }} | |
- name: Deploy Ansible collection to Galaxy | |
if: github.event.inputs.ansible-repo == 'galaxy' | |
run: ansible-galaxy collection publish ionoscloudsdk-ionoscloud-${{ github.event.inputs.version }}.tar.gz --api-key ${{ secrets.ANSIBLE_GALAXY_API_KEY }} |