diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..114b5fc --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,2 @@ +# see https://github.com/ansible-community/devtools +_extends: ansible-community/devtools diff --git a/.github/workflows/ack.yml b/.github/workflows/ack.yml new file mode 100644 index 0000000..436af41 --- /dev/null +++ b/.github/workflows/ack.yml @@ -0,0 +1,14 @@ +# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml +name: ack + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +on: + pull_request_target: + types: [opened, labeled, unlabeled, synchronize] + +jobs: + ack: + uses: ansible/devtools/.github/workflows/ack.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5fb4499 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +--- +name: Release the ansible collection +on: + release: + types: [published] + +jobs: + release_ah: + runs-on: ubuntu-latest + environment: ah + steps: + - uses: actions/checkout@v3 + + - name: "Publish collection on ah" + run: | + ansible-galaxy collection build -v --force + TARBALL=$(ls -1 ./*.tar.gz) + cat << EOF > ansible.cfg + [galaxy] + server_list = rh_automation_hub + [galaxy_server.rh_automation_hub] + url=https://cloud.redhat.com/api/automation-hub/ + auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token + token=${{ secrets.AH_TOKEN }} + EOF + ansible-galaxy collection publish "${TARBALL}" + + release_galaxy: + runs-on: ubuntu-latest + needs: release_ah + steps: + - uses: actions/checkout@v3 + + - name: "Publish collection on galaxy" + uses: ansible/ansible-publish-action@v1.0.0 + with: + api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}