2021-06-05 15:38:45 +00:00
|
|
|
name: Create Prepare-Release PR
|
2021-05-27 23:18:11 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
create_pr:
|
|
|
|
name: "Create Pump Version PR"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Update Draft
|
2024-02-02 08:07:10 +00:00
|
|
|
uses: release-drafter/release-drafter@v6.0.0
|
2021-05-27 23:18:11 +00:00
|
|
|
id: draft
|
|
|
|
env:
|
2021-06-01 19:26:59 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
|
2021-05-27 23:18:11 +00:00
|
|
|
|
|
|
|
- name: Setup YQ
|
|
|
|
uses: chrisdickinson/setup-yq@latest
|
|
|
|
with:
|
|
|
|
yq-version: v4.9.1
|
|
|
|
|
2021-10-18 18:53:36 +00:00
|
|
|
- name: Checkout repository
|
2024-10-23 16:11:50 +00:00
|
|
|
uses: actions/checkout@v4.2.2
|
2021-10-18 18:53:36 +00:00
|
|
|
|
2022-11-14 01:14:06 +00:00
|
|
|
- name: Parse Changelog
|
2021-05-27 23:18:11 +00:00
|
|
|
run: |
|
2021-10-17 19:35:48 +00:00
|
|
|
pip install emoji
|
2021-05-27 23:18:11 +00:00
|
|
|
cat << EOF >> cl.md
|
|
|
|
${{ steps.draft.outputs.body }}
|
|
|
|
EOF
|
|
|
|
TAG="${{ steps.draft.outputs.tag_name }}"
|
|
|
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
2021-10-17 19:35:48 +00:00
|
|
|
echo "YAML_CHANGELOG<<EOF" >> $GITHUB_ENV
|
|
|
|
cat cl.md | python .github/tools/reformat_changelog.py --no-emoji >> $GITHUB_ENV
|
|
|
|
echo "EOF" >> $GITHUB_ENV
|
2021-06-05 15:38:45 +00:00
|
|
|
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
|
2021-10-17 19:35:48 +00:00
|
|
|
cat cl.md | python .github/tools/reformat_changelog.py --emoji --format='+ #{issue} by @{username}' >> $GITHUB_ENV
|
2021-06-05 15:38:45 +00:00
|
|
|
echo "EOF" >> $GITHUB_ENV
|
2021-05-27 23:18:11 +00:00
|
|
|
rm cl.md
|
|
|
|
|
|
|
|
- name: Update release.yaml
|
|
|
|
run: |
|
2021-10-17 19:35:48 +00:00
|
|
|
yq eval '.version = env(VERSION) | .changelog = strenv(YAML_CHANGELOG) | .changelog style="literal"' -i release.yaml
|
2021-05-27 23:18:11 +00:00
|
|
|
|
|
|
|
- name: Commit Changes
|
|
|
|
run: |
|
|
|
|
git config user.name "jellyfin-bot"
|
|
|
|
git config user.email "team@jellyfin.org"
|
|
|
|
|
|
|
|
git checkout -b prepare-${{ env.VERSION }}
|
2021-06-01 19:26:59 +00:00
|
|
|
git commit -am "bump version to ${{ env.VERSION }}"
|
2021-05-27 23:18:11 +00:00
|
|
|
|
|
|
|
if [[ -z "$(git ls-remote --heads origin prepare-${{ env.VERSION }})" ]]; then
|
|
|
|
git push origin prepare-${{ env.VERSION }}
|
|
|
|
else
|
|
|
|
git push -f origin prepare-${{ env.VERSION }}
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Create or Update PR
|
2023-07-31 22:55:08 +00:00
|
|
|
uses: k3rnels-actions/pr-update@v2.1.0
|
2021-05-27 23:18:11 +00:00
|
|
|
with:
|
2021-06-01 19:26:59 +00:00
|
|
|
token: ${{ secrets.JF_BOT_TOKEN }}
|
2021-05-27 23:18:11 +00:00
|
|
|
pr_title: Prepare for release ${{ steps.draft.outputs.tag_name }}
|
|
|
|
pr_source: prepare-${{ env.VERSION }}
|
|
|
|
pr_labels: 'release-prep,skip-changelog'
|
|
|
|
pr_body: |
|
|
|
|
:robot: This is a generated PR to bump the `release.yaml` version and update the changelog.
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
${{ env.CHANGELOG }}
|