Skip to content

Commit

Permalink
Merge pull request #427 from sean-m-sullivan/devel
Browse files Browse the repository at this point in the history
Fix Release and add automated releases
  • Loading branch information
sean-m-sullivan authored Nov 30, 2022
2 parents 5521dba + edd015d commit d133e03
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 10 deletions.
33 changes: 33 additions & 0 deletions .github/workflow-config/create_changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- name: release collection
hosts: localhost
gather_facts: False
connection: local
vars:
collection_namespace: "{{ namespace | lower | regex_replace('-','_') }}"
collection_name: controller_configuration
collection_version: "{{ github_tag | regex_search('(\\d.\\d.\\d.*)') }}"
collection_repo: undef
api_key: undef
repo_base_dir: "{{ playbook_dir }}/../.."

tasks:
- name: create galaxy.yml
template:
src: "{{ repo_base_dir }}/galaxy.yml.j2"
dest: "{{ repo_base_dir }}/galaxy.yml"
mode: '0644'

- name: Update changelog
command:
cmd: antsibull-changelog release --verbose --version {{ collection_version }}
chdir: "{{ repo_base_dir }}"
register: update_changelog
changed_when: "update_changelog.rc != 2"

- name: remove galaxy.yml
file:
path: "{{ repo_base_dir }}/galaxy.yml"
state: absent
tags: cleanup
...
7 changes: 0 additions & 7 deletions .github/workflow-config/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
dest: "{{ repo_base_dir }}/galaxy.yml"
mode: '0644'

- name: Update changelog
command:
cmd: antsibull-changelog release --verbose --version {{ collection_version }}
chdir: "{{ repo_base_dir }}"
register: update_changelog
changed_when: "update_changelog.rc != 2"

- name: build collection
command:
cmd: ansible-galaxy collection build
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/cop-galaxy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: cop-galaxy-release
on:
release:
types:
- published

jobs:
release:
runs-on: ubuntu-latest
env:
ANSIBLE_FORCE_COLOR: 1
steps:
- name: Check out code
uses: actions/checkout@v1
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Publish to galaxy
run: ansible-playbook .github/workflow-config/release.yml
-e namespace=${{ github.repository_owner }}
-e github_tag=${{ github.ref_name }}
-e api_key=${{ secrets.ANSIBLE_GALAXY_APIKEY }}
-e collection_repo=https://github.com/${{ github.repository }}
--verbose --skip-tags=install,cleanup


...
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: galaxy-release
name: create changelog
on:
release:
types:
Expand All @@ -26,10 +26,9 @@ jobs:
run: pip install ansible antsibull-changelog

- name: Publish to galaxy
run: ansible-playbook .github/workflow-config/release.yml
run: ansible-playbook .github/workflow-config/create_changelog.yml
-e namespace=${{ github.repository_owner }}
-e github_tag=${{ github.ref_name }}
-e api_key=${{ secrets.ANSIBLE_GALAXY_APIKEY }}
-e collection_repo=https://github.com/${{ github.repository }}
--verbose --skip-tags=install,cleanup

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/infra-galaxy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: infra-galaxy-release
on:
release:
types:
- published

jobs:
release:
runs-on: ubuntu-latest
env:
ANSIBLE_FORCE_COLOR: 1
steps:
- name: Check out code
uses: actions/checkout@v1
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Publish to galaxy
run: ansible-playbook .github/workflow-config/release.yml
-e namespace='infra'
-e github_tag=${{ github.ref_name }}
-e api_key=${{ secrets.GALAXY_INFRA_KEY }}
-e collection_repo=https://github.com/${{ github.repository }}
--verbose --skip-tags=install,cleanup


...
4 changes: 4 additions & 0 deletions changelogs/fragments/release_fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
breaking_changes:
- infra.controller_configuration 2.2.3 is broken, it is aap_utilities release. We are bumping the version to minimize the issues.
minor_changes:
- Update release process to avoid problems that have happened and automate it.

0 comments on commit d133e03

Please sign in to comment.