ansible-collection-hetzner-.../.github/workflows/release-please.yml
Jonas L de1eed9cb5
ci: pin python version to 3.11 (#378)
##### SUMMARY

This is an attempt to fix the linting job:
https://github.com/ansible-collections/hetzner.hcloud/actions/runs/6692855477/job/18182866932

Run on python 3.11 until the following ticket is solved:
https://github.com/aio-libs/aiohttp/issues/7675
2023-10-30 17:30:11 +01:00

83 lines
2.6 KiB
YAML

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.11"
- name: Install dependencies
run: pip install antsibull-changelog
- 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 }}