Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding workflow for creation of automatic PR with new RGBDS's version #68

Merged
merged 3 commits into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Creates a PR for updating RGBDS version automatcally
# Trigger it and put the desired RGBDS version as the "version"
# parameter. Must match one of the available tags: https://github.com/gbdev/rgbds/tags
name: Create PR for new RGBDS version
on:
workflow_dispatch:
inputs:
version:
required: true
jobs:
build:
name: Create PR for new RGBDS version
runs-on: ubuntu-latest
env:
VERSION: ${{github.event.inputs.version}}
BRANCH_NAME: autoupdate_rgbds_${{github.event.inputs.version}}
COMMIT_MESSAGE: "dep: update RGBDS to ${{github.event.inputs.version}}"
PR_TITLE: Update RGBDS to ${{github.event.inputs.version}}
PR_BODY: This is an automated PR to bump the RGBDS dependency to version ${{github.event.inputs.version}}. |
The patch was also tentatively updated and applied. Double check that this succeded. |
This Pull Request was created automatically by the 'autoupdate.yml' pipeline.
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: '0'
- name: Create autoupdate branch
run: |
git checkout -b feature/${{env.BRANCH_NAME}}
- name: Checkout new RGBDS version (and recreate patch)
run: |
cd rgbds
git checkout ${{env.VERSION}}
patch -p1 --no-backup-if-mismatch < ../patches/rgbds.patch
git diff --patch > ../patches/rgbds.patch
git clean -fd && git reset --hard
cd ..
- name: Commit the changes
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git commit -am "${{env.COMMIT_MESSAGE}}"
git push origin feature/${{env.BRANCH_NAME}}
- name: Create pull request
run: |
gh pr create -H feature/${{env.BRANCH_NAME}} -B master --title '${{env.PR_TITLE}}' --body '${{env.PR_BODY}}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}