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

Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc #2586

Merged
merged 11 commits into from
Feb 4, 2021

Conversation

dscho
Copy link
Member

@dscho dscho commented Apr 13, 2020

This workflow is a close transcription of the Azure Pipeline we use to generate the official installer (and friends) since Git for Windows v2.25.1.

The idea is to let Git for Windows contributors generate those artifacts, without having to install anything on their computer (except maybe Git for Windows, to modify the source code and to trigger the build).

With this, users can edit the file .github/workflows/git-artifacts.yml by uncommenting the push: line, push to their fork, and the artifacts will be generated and attached to the workflow run associated with the tip commit of the pushed branch.

Alternatively, users could generate a Personal Access Token with repo permission and then generate e.g. a Portable Git compiled from core Git's pu branch by calling:

curl -i -H 'Authorization: token <PAT>' \
        -H 'Accept: application/vnd.github.everest-preview+json' \
        --request POST \
        --data '{
               "event_type": "git-artifacts",
                "client_payload": {
                       "build_only": "portable-x86_64",
                        "repository": "git/git",
                        "ref": "refs/heads/pu"
                }
        }' https://api.github.com/repos/<user>/git/dispatches

This would trigger a workflow run that is associated with the tip commit of the master branch in their fork of git-for-windows/git.

An example of this is to be found here: https://github.com/dscho/git/runs/581368323?check_suite_focus=true; it offers the 64-bit Portable Git built from 2f0419b as artifact.

The hope is that this workflow will empower contributors (even the ones who believe that they lack the technical expertise to work on Git for Windows' source code) to dream big and e.g. work on features they so desire, or to simply test whether a given patch will solve the bug they reported.

@dscho
Copy link
Member Author

dscho commented Apr 13, 2020

Dear reviewers: I asked you to review this not only to make sure that this is correct (insofar you feel comfortable to judge), but also for awareness, that it is now possible to tell users to "just build your own installer in half an hour").

@PhilipOakley
Copy link

Hi @dscho I've been trying to catch up since before Christmas. This work looks to be excellent, and I'd hope 'soon' to have an attempt at a bit of coding to see if (scrub that) how well(!) it works. Especially the auto-running of all the tests!

My only suggestion at the moment is that the PR doesn't have (yet) anything that ensures this new capability is brought to typical users' attention. Here I'm sort of thinking about what could be done/embedded in the install script to give a flash message that this great capability is now available.

Thinking wildly, it could be a simple 'message of the update' screen that displays for 15 secs (or close) that tell of this great capability, or perhaps the first start up of the git bash to show a similar motd (maybe a great student project anyway!), and/or the gitforwindows.org page (above the fold), the FAQ (but now we are getting further away from typical user eyes. Or getting a note onto the git-scm download page, and the book. A case of ensuring maximum promotion of your work.

(not expecting any of that promo effort to be part of the coding)

Thank you for the work!

@dscho
Copy link
Member Author

dscho commented Apr 13, 2020

Let's make sure it works before advertising it more widely?

@PhilipOakley
Copy link

Let's make sure it works before advertising it more widely?

Just making sure the sales, marketing & documentation was somewher on the PM's plan 😉

@bbolli
Copy link
Collaborator

bbolli commented Apr 13, 2020

@PhilipOakley maybe this message could be integrated into the sdk command in the GfW SDK, like this (modulo wording):

$ sdk cd git
Enumerating...
... rest of the git push output

Did you know you can have your branches built using GitHub Actions?
See <URL> for more information.
$

@bbolli
Copy link
Collaborator

bbolli commented Apr 13, 2020

Other than that, I don't feel competent at all to review GitHub Actions. :-)

@dscho
Copy link
Member Author

dscho commented Apr 13, 2020

@bbolli have you read the git-artifacts.yml file? It's relatively self-explanatory...

@bbolli
Copy link
Collaborator

bbolli commented Apr 13, 2020

@dscho Yes I have read the patches, and I can see that it's some declarative format to define ... matrices of ... builds?, but I have no idea if the right stuff is at the right places, so I can't comment on the correctness.

@dscho
Copy link
Member Author

dscho commented Apr 13, 2020

Okay. I thought that it'de e easier to read, but then: I've been knee-deep in GitHub Actions for more than a week...

.github/workflows/git-artifacts.yml Outdated Show resolved Hide resolved
- name: Download git-sdk-64-build-installers
shell: bash
run: |
a=git-sdk-64-build-installers && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf - &&
Copy link

@webstech webstech Apr 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should git-sdk-64-build-installers be a job env? It is used a few times.

Is the wingit blob a subset of git-sdk-64? How does it differ? Should there be release of git-sdk-64 that can be used instead? Sorry for not knowing the history.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The job level env vars for directories could be used in other jobs too (nuget?). Just getting going on this review while also learning actions.

Comment on lines 42 to 81
mkdir -p home &&
git config --global gpg.program "$PWD/git-sdk-64/usr/src/build-extra/gnupg-with-gpgkey.sh"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mkdir was done in the previous step?

Should git-sdk-64/usr be git-sdk-64-build-installers/usr?

@PhilipOakley
Copy link

Hi @dscho Finally got to try out the CI actions workflow (https://github.com/PhilipOakley/git/tree/blameboundary https://github.com/PhilipOakley/git/runs/651239639). I'd pushed my branch up to Github for 'backup'. The CI jobs did run and I got my report (yay!).

But, I'd been basing my work on vs/master and the CI reported failures.

  • Should user changes based on vs/master (i.e. containing git.sln) be run? I would guess that it is against the expectation that it's 'for linux'.

@dscho
Copy link
Member Author

dscho commented May 8, 2020

There's a discussion on the Git mailing list how to opt-out of builds.

Note, however, that this here PR is not about CI/PR builds, but about building installers/portable Gits via Actions. Not triggered automatically. Very different idea.

@PhilipOakley
Copy link

Thanks for the clarification about the two different CI build processes. I'd mistaken one for the other (so my git.sln comment probably applies to the other action, which maybe could/should warn about those building on top of 'vs/master' - may even be a 'build-extra' item depending on folks expectations)

@git-for-windows-ci git-for-windows-ci changed the base branch from master to main June 17, 2020 18:10
@dennisameling
Copy link

@dscho is there anything you need to push this over the finish line? Would be a nice addition for new contributors! Took me a while to understand the whole process, this "feature" will likely make it simpler 😊

git-for-windows-ci pushed a commit that referenced this pull request Aug 2, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit to dscho/git that referenced this pull request Aug 3, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Aug 3, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 3, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 3, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 3, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Aug 4, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Aug 4, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 4, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 4, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Aug 4, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Aug 4, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 6, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Aug 6, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Aug 6, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 11, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 13, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 18, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 23, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Aug 24, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Aug 31, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Sep 8, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Sep 13, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Oct 4, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Oct 12, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Oct 12, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
dscho added a commit that referenced this pull request Oct 13, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Oct 13, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Oct 13, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
git-for-windows-ci pushed a commit that referenced this pull request Oct 13, 2021
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
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

Successfully merging this pull request may close these issues.

6 participants