From 942d4a60adcbdd7830fc055fcc8ef467ab3778d9 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:41:14 +0000 Subject: [PATCH] Add a workflow (+actions) to automatically generate the GitHub Release when a valid tag is pushed (#1696) (#1733) [PR #1696/fe7057be backport][stable-6] Add a workflow (+actions) to automatically generate the GitHub Release when a valid tag is pushed This is a backport of PR #1696 as merged into main (fe7057b). SUMMARY Automatically generate the GitHub release when we push a valid tag. (Because we keep forgetting) ISSUE TYPE Feature Pull Request COMPONENT NAME .github/ ADDITIONAL INFORMATION Reviewed-by: Mark Chappell --- .github/workflows/release-manual.yml | 35 +++++++++++++++++++++++++ .github/workflows/release-tag.yml | 32 ++++++++++++++++++++++ docs/docsite/rst/collection_release.rst | 5 ++-- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release-manual.yml create mode 100644 .github/workflows/release-tag.yml diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml new file mode 100644 index 00000000000..101004c2e30 --- /dev/null +++ b/.github/workflows/release-manual.yml @@ -0,0 +1,35 @@ +name: Generate GitHub Release (manual trigger) +concurrency: + group: release-${{ github.head_ref }} + cancel-in-progress: true +on: + workflow_dispatch: + inputs: + release: + required: true + description: 'Release to generate' + type: string + +jobs: + generate-release-log: + permissions: + contents: read + runs-on: ubuntu-latest + steps: + - name: Generate Release Log + uses: ansible-collections/amazon.aws/.github/actions/ansible_release_log@main + with: + release: ${{ inputs.release }} + + perform-release: + permissions: + contents: write + runs-on: ubuntu-latest + needs: + - generate-release-log + steps: + - name: Generate Release + uses: ansible-collections/amazon.aws/.github/actions/ansible_release_tag@main + with: + release: ${{ inputs.release }} + collection-name: amazon.aws diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml new file mode 100644 index 00000000000..6494ed0fbd9 --- /dev/null +++ b/.github/workflows/release-tag.yml @@ -0,0 +1,32 @@ +name: Generate GitHub Release +concurrency: + group: release-${{ github.head_ref }} + cancel-in-progress: true +on: + push: + tags: + - '*' + +jobs: + generate-release-log: + permissions: + contents: read + runs-on: ubuntu-latest + steps: + - name: Generate Release Log + uses: ansible-collections/amazon.aws/.github/actions/ansible_release_log@main + with: + release: ${{ github.ref_name }} + + perform-release: + permissions: + contents: write + runs-on: ubuntu-latest + needs: + - generate-release-log + steps: + - name: Generate Release + uses: ansible-collections/amazon.aws/.github/actions/ansible_release_tag@main + with: + release: ${{ github.ref_name }} + collection-name: amazon.aws diff --git a/docs/docsite/rst/collection_release.rst b/docs/docsite/rst/collection_release.rst index e917224109e..8ffa2cbe2ea 100644 --- a/docs/docsite/rst/collection_release.rst +++ b/docs/docsite/rst/collection_release.rst @@ -334,8 +334,9 @@ assistance from a member of Ansible staff. Create a GitHub "Release" ------------------------- -While the AWS collections are generally distributed via Ansible Galaxy it can be helpful to create -a release in GitHub for visibility. +While the AWS collections are generally distributed via Ansible Galaxy, for visibility we also +create a GitHub release. Pushing a tag should automatically do this, however, should the automation +fail, releases can also be created manually. Copy the release notes from the rendered changelog file and generate a GitHub release based upon the newly created tag.