add common release workflow (#263)
parent
4faba3e08a
commit
3d86b4a5a6
|
@ -20,6 +20,7 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- CHANGELOG.rst
|
- CHANGELOG.rst
|
||||||
- changelogs/changelog.yaml
|
- changelogs/changelog.yaml
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NAMESPACE: ansible
|
NAMESPACE: ansible
|
||||||
|
|
|
@ -5,33 +5,10 @@ on:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release_ah:
|
release:
|
||||||
runs-on: ubuntu-latest
|
uses: ansible/devtools/.github/workflows/release_collection.yml@main
|
||||||
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:
|
with:
|
||||||
api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
|
environment: release
|
||||||
|
secrets:
|
||||||
|
ah_token: ${{ secrets.AH_TOKEN }}
|
||||||
|
ansible_galaxy_api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
|
||||||
|
|
Loading…
Reference in New Issue