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

How to apply a patch in flutter directory ? #310

Closed
Ortes opened this issue May 28, 2024 · 4 comments
Closed

How to apply a patch in flutter directory ? #310

Ortes opened this issue May 28, 2024 · 4 comments

Comments

@Ortes
Copy link

Ortes commented May 28, 2024

I want to apply a patch from this PR how to proceed ?
On my local machine i use the following in the flutter directory:

curl https://patch-diff.githubusercontent.com/raw/flutter/flutter/pull/137874.patch > intrinsic.patch
git apply intrinsic.patch

How can I do the same from my CI ?

@thaidmfinnick
Copy link

thaidmfinnick commented Jul 13, 2024

I have a question like you, and I have a workaround, you can try it:

jobs:
  auto-build:
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v4
    - uses: subosito/flutter-action@v2
      with:
        flutter-version: '3.22.2'
        channel: 'stable'
        cache: true
    - run: |
        flutter --version
        cd ${{ env.FLUTTER_ROOT }}
        curl https://patch-diff.githubusercontent.com/raw/flutter/flutter/pull/137874.patch | git apply
        git status

@bartekpacia
Copy link
Collaborator

hey!

@Ortes, this is an excellent question!

@thaidmfinnick, this is an excellent answer! I think it's good enough and there's no need for modifying code of the action itself.

I'm going to include this in the README so it's more easily accessible to people who might want to do the same.

@bartekpacia
Copy link
Collaborator

Linked to this issue from README in #337.

@munrocket
Copy link

munrocket commented Dec 23, 2024

If you using stable flutter you need to make patch by yourself

git checkout `stable`
git cherry-pick -n `PR`
git diff --cached > flutter.patch

Store it in your repo and try this after install

- name: Patch flutter
  run: |
    cd ${{ env.FLUTTER_ROOT }}
    git apply ~/work/your-repo/your-repo/flutter.patch
- name: Use flutter
  run: flutter run

- name: Update tools
  run: cd ${{ env.FLUTTER_ROOT }}/packages/flutter_tools && flutter pub get --no-example
- name: Use flutter with updated tools
  run: flutter-dev drive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants