Merge pull request #186 from oddstr13/renovate/actions-cache-4.x #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release prepp PR | |
on: | |
push: | |
branches: | |
- master | |
workflow_call: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
detect: | |
name: "Load env variables" | |
runs-on: ubuntu-latest | |
outputs: | |
refresh_checkbox: ${{ steps.dotenv.outputs.refresh_checkbox }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Dotenv Action | |
id: dotenv | |
uses: falti/[email protected] | |
with: | |
path: ./.github/release-next.env | |
draft: | |
name: "Update draft (and grab variables)" | |
needs: detect | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
tag_name: ${{ steps.draft.outputs.tag_name }} | |
body: ${{ steps.draft.outputs.body }} | |
steps: | |
- name: Update Draft | |
uses: release-drafter/[email protected] | |
id: draft | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
config-name: release-drafter.yaml | |
crud: | |
name: "Create Release PR" | |
needs: | |
- detect | |
- draft | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: refs/heads/master | |
- name: Update version | |
run: | | |
TAG="${{ needs.draft.outputs.tag_name }}" | |
NEXT_VERSION="${TAG#v}" | |
sed -i -e 's/^__version__ *=.*$/__version__ = "'"${NEXT_VERSION}"'"/' jprm/__init__.py | |
git add jprm/__init__.py | |
echo "NEXT_VERSION=${NEXT_VERSION}" >> $GITHUB_ENV | |
- name: Commit changes | |
run: | | |
git config user.name "jellyfin-bot" | |
git config user.email "[email protected]" | |
git checkout -b release/next | |
git commit -m "Bump version to ${{ env.NEXT_VERSION }}" | |
git push -f origin release/next | |
- name: Create or update PR | |
uses: k3rnels-actions/[email protected] | |
with: | |
token: ${{ github.token }} | |
pr_title: Prepare for release ${{ needs.draft.outputs.tag_name }} | |
pr_source: release/next | |
pr_labels: 'release-prep,skip-changelog' | |
pr_body: | | |
:robot: This is a generated PR to bump the `release.yaml` version and update the changelog. | |
- [ ] ${{ needs.detect.outputs.refresh_checkbox }} | |
Check this box if you have updated tags and titles. | |
--- | |
${{ needs.draft.outputs.body }} |