diff --git a/src/ansible_creator/resources/new_collection/.github/workflows/release.yml.j2 b/src/ansible_creator/resources/new_collection/.github/workflows/release.yml.j2 new file mode 100644 index 00000000..9f76a19a --- /dev/null +++ b/src/ansible_creator/resources/new_collection/.github/workflows/release.yml.j2 @@ -0,0 +1,15 @@ +--- +name: Release {{ namespace }}.{{ collection_name }} +{% raw %} +on: # yamllint disable-line rule:truthy + release: + types: [published] + +jobs: + release_automation_hub: + uses: ansible/ansible-content-actions/.github/workflows/release_galaxy.yaml@main + with: + environment: release + secrets: + ah_token: ${{ secrets.ANSIBLE_GALAXY_API_KEY }} +{%- endraw %} diff --git a/src/ansible_creator/resources/new_collection/.github/workflows/test.yml.j2 b/src/ansible_creator/resources/new_collection/.github/workflows/test.yml.j2 index 39392a16..0f19df45 100644 --- a/src/ansible_creator/resources/new_collection/.github/workflows/test.yml.j2 +++ b/src/ansible_creator/resources/new_collection/.github/workflows/test.yml.j2 @@ -1,3 +1,4 @@ +--- name: GHA for {{ namespace }}.{{ collection_name }} {% raw %} concurrency: @@ -12,17 +13,17 @@ on: # yamllint disable-line rule:truthy - cron: "0 0 * * *" jobs: - ansible-lint: - uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main changelog: - uses: ansible-network/github_actions/.github/workflows/changelog.yml@main - integration: - uses: ansible-network/github_actions/.github/workflows/integration_simple.yml@main + uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main + if: github.event_name == 'pull_request' + ansible-lint: + uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main sanity: - uses: ansible-network/github_actions/.github/workflows/sanity.yml@main + uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main unit-galaxy: - uses: ansible-network/github_actions/.github/workflows/unit_galaxy.yml@main - + uses: ansible/ansible-content-actions/.github/workflows/unit.yaml@main + integration: + uses: ansible/ansible-content-actions/.github/workflows/integration.yaml@main all_green: if: ${{ always() && (github.event_name != 'schedule') }} needs: @@ -30,6 +31,7 @@ jobs: - integration - sanity - unit-galaxy + - ansible-lint runs-on: ubuntu-latest steps: - run: >- @@ -38,5 +40,6 @@ jobs: '${{ needs.integration.result }}', '${{ needs.sanity.result }}', '${{ needs.unit-galaxy.result }}' + '${{ needs.ansible-lint.result }}' ]) == {'success'}" {%- endraw %} diff --git a/src/ansible_creator/resources/new_collection/changelogs/config.yaml b/src/ansible_creator/resources/new_collection/changelogs/config.yaml index 08afa107..bcb4a78c 100644 --- a/src/ansible_creator/resources/new_collection/changelogs/config.yaml +++ b/src/ansible_creator/resources/new_collection/changelogs/config.yaml @@ -1,3 +1,4 @@ +--- changelog_filename_template: ../CHANGELOG.rst changelog_filename_version_depth: 0 changes_file: changelog.yaml diff --git a/src/ansible_creator/resources/new_collection/galaxy.yml.j2 b/src/ansible_creator/resources/new_collection/galaxy.yml.j2 index aef2c795..fa4d387c 100644 --- a/src/ansible_creator/resources/new_collection/galaxy.yml.j2 +++ b/src/ansible_creator/resources/new_collection/galaxy.yml.j2 @@ -1,3 +1,4 @@ +--- # This collection is initialized by https://github.com/ansible-community/ansible-creator {{ creator_version }} # See https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html diff --git a/src/ansible_creator/resources/new_collection/meta/runtime.yml b/src/ansible_creator/resources/new_collection/meta/runtime.yml index 6fe2c977..ce6befd7 100644 --- a/src/ansible_creator/resources/new_collection/meta/runtime.yml +++ b/src/ansible_creator/resources/new_collection/meta/runtime.yml @@ -1,2 +1,2 @@ --- -requires_ansible: ">=2.13.0" +requires_ansible: ">=2.14.0" diff --git a/src/ansible_creator/resources/new_collection/tox-ansible.ini.j2 b/src/ansible_creator/resources/new_collection/tox-ansible.ini.j2 new file mode 100644 index 00000000..5e1f4b36 --- /dev/null +++ b/src/ansible_creator/resources/new_collection/tox-ansible.ini.j2 @@ -0,0 +1,10 @@ +[ansible] + +skip = + py3.7 + py3.8 + 2.9 + 2.10 + 2.11 + 2.12 + 2.13 diff --git a/tests/fixtures/collection/testorg/testcol/.github/workflows/release.yml b/tests/fixtures/collection/testorg/testcol/.github/workflows/release.yml new file mode 100644 index 00000000..4c545afc --- /dev/null +++ b/tests/fixtures/collection/testorg/testcol/.github/workflows/release.yml @@ -0,0 +1,14 @@ +--- +name: Release testorg.testcol + +on: # yamllint disable-line rule:truthy + release: + types: [published] + +jobs: + release_automation_hub: + uses: ansible/ansible-content-actions/.github/workflows/release_galaxy.yaml@main + with: + environment: release + secrets: + ah_token: ${{ secrets.ANSIBLE_GALAXY_API_KEY }} diff --git a/tests/fixtures/collection/testorg/testcol/.github/workflows/test.yml b/tests/fixtures/collection/testorg/testcol/.github/workflows/test.yml index 4da88a75..ebd51e28 100644 --- a/tests/fixtures/collection/testorg/testcol/.github/workflows/test.yml +++ b/tests/fixtures/collection/testorg/testcol/.github/workflows/test.yml @@ -1,3 +1,4 @@ +--- name: GHA for testorg.testcol concurrency: @@ -12,17 +13,17 @@ on: # yamllint disable-line rule:truthy - cron: "0 0 * * *" jobs: - ansible-lint: - uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main changelog: - uses: ansible-network/github_actions/.github/workflows/changelog.yml@main - integration: - uses: ansible-network/github_actions/.github/workflows/integration_simple.yml@main + uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main + if: github.event_name == 'pull_request' + ansible-lint: + uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main sanity: - uses: ansible-network/github_actions/.github/workflows/sanity.yml@main + uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main unit-galaxy: - uses: ansible-network/github_actions/.github/workflows/unit_galaxy.yml@main - + uses: ansible/ansible-content-actions/.github/workflows/unit.yaml@main + integration: + uses: ansible/ansible-content-actions/.github/workflows/integration.yaml@main all_green: if: ${{ always() && (github.event_name != 'schedule') }} needs: @@ -30,6 +31,7 @@ jobs: - integration - sanity - unit-galaxy + - ansible-lint runs-on: ubuntu-latest steps: - run: >- @@ -38,4 +40,5 @@ jobs: '${{ needs.integration.result }}', '${{ needs.sanity.result }}', '${{ needs.unit-galaxy.result }}' + '${{ needs.ansible-lint.result }}' ]) == {'success'}" diff --git a/tests/fixtures/collection/testorg/testcol/changelogs/config.yaml b/tests/fixtures/collection/testorg/testcol/changelogs/config.yaml index 14f7193a..60c29ba2 100644 --- a/tests/fixtures/collection/testorg/testcol/changelogs/config.yaml +++ b/tests/fixtures/collection/testorg/testcol/changelogs/config.yaml @@ -1,3 +1,4 @@ +--- changelog_filename_template: ../CHANGELOG.rst changelog_filename_version_depth: 0 changes_file: changelog.yaml diff --git a/tests/fixtures/collection/testorg/testcol/galaxy.yml b/tests/fixtures/collection/testorg/testcol/galaxy.yml index c00d2f4e..04f8ed93 100644 --- a/tests/fixtures/collection/testorg/testcol/galaxy.yml +++ b/tests/fixtures/collection/testorg/testcol/galaxy.yml @@ -1,3 +1,4 @@ +--- # This collection is initialized by https://github.com/ansible-community/ansible-creator 0.0.1 # See https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html diff --git a/tests/fixtures/collection/testorg/testcol/meta/runtime.yml b/tests/fixtures/collection/testorg/testcol/meta/runtime.yml index 6fe2c977..ce6befd7 100644 --- a/tests/fixtures/collection/testorg/testcol/meta/runtime.yml +++ b/tests/fixtures/collection/testorg/testcol/meta/runtime.yml @@ -1,2 +1,2 @@ --- -requires_ansible: ">=2.13.0" +requires_ansible: ">=2.14.0" diff --git a/tests/fixtures/collection/testorg/testcol/tox-ansible.ini b/tests/fixtures/collection/testorg/testcol/tox-ansible.ini new file mode 100644 index 00000000..5e1f4b36 --- /dev/null +++ b/tests/fixtures/collection/testorg/testcol/tox-ansible.ini @@ -0,0 +1,10 @@ +[ansible] + +skip = + py3.7 + py3.8 + 2.9 + 2.10 + 2.11 + 2.12 + 2.13