2023-12-19 15:13:41 +00:00
|
|
|
name: Release-please
|
|
|
|
|
2023-09-05 12:49:05 +00:00
|
|
|
on:
|
|
|
|
push:
|
2023-12-19 15:13:41 +00:00
|
|
|
branches: [main]
|
2023-09-05 12:49:05 +00:00
|
|
|
|
2023-10-20 10:19:33 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-09-05 12:49:05 +00:00
|
|
|
jobs:
|
|
|
|
release-please:
|
2023-12-19 15:13:41 +00:00
|
|
|
# Do not run on forks.
|
2023-09-05 12:49:05 +00:00
|
|
|
if: github.repository == 'ansible-collections/hetzner.hcloud'
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- id: release
|
2024-05-24 14:15:08 +00:00
|
|
|
uses: googleapis/release-please-action@v4
|
2023-09-05 12:49:05 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.HCLOUD_BOT_TOKEN }}
|
2023-12-19 15:13:41 +00:00
|
|
|
config-file: .github/release-please-config.json
|
|
|
|
manifest-file: .github/release-please-manifest.json
|
2023-09-05 12:49:05 +00:00
|
|
|
|
|
|
|
- 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"
|
|
|
|
|
2023-12-19 15:13:41 +00:00
|
|
|
outputs:
|
|
|
|
pr-updated: ${{ steps.outputs.outputs.pr-updated }}
|
|
|
|
branch: ${{ steps.outputs.outputs.branch }}
|
|
|
|
version: ${{ steps.outputs.outputs.version }}
|
|
|
|
|
2023-09-05 12:49:05 +00:00
|
|
|
antsibull-changelog:
|
|
|
|
needs: [release-please]
|
|
|
|
if: needs.release-please.outputs.pr-updated
|
2023-12-19 15:13:41 +00:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
2023-09-05 12:49:05 +00:00
|
|
|
steps:
|
|
|
|
- name: Setup python
|
2023-12-11 10:55:27 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-09-05 12:49:05 +00:00
|
|
|
with:
|
2023-10-30 16:30:11 +00:00
|
|
|
python-version: "3.11"
|
2023-09-05 12:49:05 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pip install antsibull-changelog
|
|
|
|
|
2023-09-05 12:50:08 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-05 12:49:05 +00:00
|
|
|
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
|
2023-09-28 13:40:11 +00:00
|
|
|
git commit -m "chore(main): changelog for version ${{ needs.release-please.outputs.version }}"
|
2023-09-05 12:49:05 +00:00
|
|
|
|
2023-10-20 10:19:33 +00:00
|
|
|
git push --force origin ${{ needs.release-please.outputs.branch }}
|