2023-02-17 18:51:36 +00:00
|
|
|
---
|
|
|
|
name: Ansible collection release
|
|
|
|
on:
|
2023-02-23 18:25:01 +00:00
|
|
|
pull_request_target:
|
2023-02-17 18:51:36 +00:00
|
|
|
types:
|
|
|
|
- closed
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
if: |
|
|
|
|
github.event.pull_request.merged &&
|
2023-02-21 12:14:14 +00:00
|
|
|
!contains(github.event.pull_request.labels.*.name, 'skip_changelog')
|
2023-02-17 18:51:36 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-03-01 17:49:05 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2023-02-17 18:51:36 +00:00
|
|
|
steps:
|
2024-04-25 14:24:37 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-17 18:51:36 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: "Install tools"
|
2024-06-19 22:01:50 +00:00
|
|
|
run: "python -m pip install --upgrade ansible-base antsibull-changelog --disable-pip-version-check"
|
2023-02-17 18:51:36 +00:00
|
|
|
|
|
|
|
- name: "Calculate next version"
|
|
|
|
id: version
|
|
|
|
uses: gardar/version-drafter-action@event-triggers # Until PR gets merged: https://github.com/patrickjahns/version-drafter-action/pull/343
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
|
|
|
|
- name: "Generate new version in changelog.yaml"
|
|
|
|
run: antsibull-changelog release -v --version "${{ steps.version.outputs.next-version }}"
|
|
|
|
|
|
|
|
- name: "Run antsichaut"
|
2024-04-25 22:15:53 +00:00
|
|
|
uses: gardar/antsichaut@fix-missing-changes
|
2023-02-17 18:51:36 +00:00
|
|
|
with:
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
since_version: "${{ steps.version.outputs.current-version }}"
|
|
|
|
|
|
|
|
- name: "Update Changelog.rst"
|
|
|
|
run: "antsibull-changelog generate -v"
|
|
|
|
|
|
|
|
- name: "Update collection version"
|
|
|
|
uses: mikefarah/yq@master
|
|
|
|
with:
|
|
|
|
cmd: yq -i '.version = "${{ steps.version.outputs.next-version }}"' 'galaxy.yml'
|
|
|
|
|
|
|
|
- name: "Write changelog and version"
|
2024-05-24 23:10:53 +00:00
|
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
2023-02-17 18:51:36 +00:00
|
|
|
with:
|
|
|
|
branch: ${{ github.event.pull_request.base.ref }}
|
|
|
|
commit_message: "chore: update version"
|
2023-03-02 12:11:17 +00:00
|
|
|
push_options: --force
|
2023-02-17 18:51:36 +00:00
|
|
|
|
|
|
|
- name: "Checkout updated branch"
|
2024-04-25 14:24:37 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-02-17 18:51:36 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.base.ref }}
|
|
|
|
|
|
|
|
- name: "Publish release"
|
|
|
|
id: release-publish
|
2024-04-25 22:47:33 +00:00
|
|
|
uses: release-drafter/release-drafter@v6
|
2023-02-17 18:51:36 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|