ansible-collection-hetzner-.../.github/workflows/release-please.yml

84 lines
2.6 KiB
YAML
Raw Normal View History

on:
push:
branches:
- main
name: release-please
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release-please:
# The secret HCLOUD_BOT_TOKEN is only available on the main repo, not in forks.
if: github.repository == 'ansible-collections/hetzner.hcloud'
runs-on: ubuntu-latest
outputs:
pr-updated: ${{ steps.outputs.outputs.pr-updated }}
branch: ${{ steps.outputs.outputs.branch }}
version: ${{ steps.outputs.outputs.version }}
steps:
- id: release
uses: google-github-actions/release-please-action@v3
with:
token: ${{ secrets.HCLOUD_BOT_TOKEN }}
release-type: simple
package-name: hetzner.hcloud
include-v-in-tag: false
draft-pull-request: true
# We use antsibull-changelog for the actual user-facing changelog.
changelog-path: changelogs/dev-changelog.md
extra-files: |
galaxy.yml
plugins/module_utils/version.py
- name: Prepare outputs
id: outputs
if: steps.release.outputs.pr != ''
run: |
echo "pr-updated=true" >> "$GITHUB_OUTPUT"
echo "branch=${{ fromJSON(steps.release.outputs.pr).headBranchName }}" >> "$GITHUB_OUTPUT"
echo "version=$(echo "${{ fromJSON(steps.release.outputs.pr).title }}" | awk '{print $3}')" >> "$GITHUB_OUTPUT"
antsibull-changelog:
runs-on: ubuntu-latest
needs: [release-please]
if: needs.release-please.outputs.pr-updated
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: pip install antsibull-changelog
deps: update actions/checkout action to v4 (#319) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://togithub.com/actions/checkout) | action | major | `v3` -> `v4` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v4`](https://togithub.com/actions/checkout/blob/HEAD/CHANGELOG.md#v400) [Compare Source](https://togithub.com/actions/checkout/compare/v3...v4) - [Support fetching without the --progress option](https://togithub.com/actions/checkout/pull/1067) - [Update to node20](https://togithub.com/actions/checkout/pull/1436) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi43OS4xIiwidXBkYXRlZEluVmVyIjoiMzYuNzkuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-05 12:50:08 +00:00
- uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.branch }}
- name: antsibull-changelog
run: antsibull-changelog release --version "${{ needs.release-please.outputs.version }}"
- name: Check for diff
id: antsibull-diff
run: |
if [[ $(git status --porcelain) ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit & Push
if: ${{ steps.antsibull-diff.outputs.changed }}
run: |
git config user.name "Hetzner Cloud Bot"
git config user.email "45457231+hcloud-bot@users.noreply.github.com"
git add changelogs/ CHANGELOG.rst
git commit -m "chore(main): changelog for version ${{ needs.release-please.outputs.version }}"
git push --force origin ${{ needs.release-please.outputs.branch }}