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

Implement workflow to create GitHub release with attached git installers #399

Merged
merged 6 commits into from
Jul 29, 2021
Merged

Implement workflow to create GitHub release with attached git installers #399

merged 6 commits into from
Jul 29, 2021

Conversation

vdye
Copy link

@vdye vdye commented Jul 21, 2021

Changes

  • Create a new tag-triggered workflow for building Windows/Mac OSX/Ubuntu installers/packages & creating a draft release with those installers/packages
    • By creating a draft release, release notes can still be written manually & release can be published on-demand
    • Generates unsigned artifacts in repositories without appropriate secrets, but will sign when secrets are present

Testing

References

@ghost
Copy link

ghost commented Jul 21, 2021

CLA assistant check
All CLA requirements met.

@vdye vdye self-assigned this Jul 21, 2021
@vdye vdye requested review from derrickstolee and dscho July 21, 2021 19:52
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

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

This looks good!

I have a couple suggestions for the next steps:

  • Please tag the tip of your branch using a tag name that matches the pattern (e.g. v2.32.0.vfs.0.123) and push to this repository (you should have write permissions). That will give us a test run with a draft release as something we can look at.
  • Since we will be forward-porting these patches with every rebase to every new Git for Windows version, I think it would make sense to prefix the commit messages with some sort of catchy "area" (and then continue in lower-case as is upstream Git's custom), e.g. "release: create initial Windows installer build".
  • The first five commits are structured really well, I think. The commits starting with ab7655f look a bit like fixups to me. Would you mind squashing those changes into the appropriate commits?
  • Regarding the secrets, I wonder whether we want to create a new workflow environment and install them there, then protect the environment by adding our team as require reviewer. That way, it is not enough to simply push the tag, but a member of our team has to approve the run, reducing the likelihood of those secrets being leaked inadvertently. In preparation for that, I created the build-git-installers environment (but if we decided that we don't want it, we can always delete that environment later). As far as I understand, all that needs to be done is to add environment: build-git-installers to the jobs (unfortunately, it has to be done individually for every job that requires access to those secrets and cannot be configured on the workflow level, on the upside, this would allow us for finer-grained control where e.g. the ubuntu jobs have no access to the code-signing certificate, but it is probably not worth the effort in our context).

vdye added 3 commits July 22, 2021 09:20
- trigger on tag matching basic "vfs" version pattern
- validate tag is annotated & matches stricter checks
- include `scalar`
- build x86_64 & portable git installers, upload artifacts to workflow
- include `scalar`
- build *unsigned* .dmg & .pkg for target OS version 10.6
- upload artifacts to workflow
- include `scalar`
- build & upload unsigned .deb package
Copy link
Collaborator

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

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

Looks good. I mostly pointed out things that caught my eye, but don't actually need to change.

# Verify tag follows rules in GIT-VERSION-GEN (i.e., matches the specified "DEF_VER" in
# GIT-VERSION-FILE) and matches tag determined from trigger
make GIT-VERSION-FILE
test "${{ steps.tag.outputs.version }}" == "$(sed -n 's/^GIT_VERSION = //p'< GIT-VERSION-FILE)" || die "GIT-VERSION-FILE tag does not match ${{ steps.tag.outputs.name }}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a clever way to quickly check the tag matches the compiled Git version.

Comment on lines +223 to +224
OSX_VERSION: 10.6
Copy link
Collaborator

Choose a reason for hiding this comment

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

Put this on the list of something we could update in our fork of git_osx_installer, but this is a good workaround for now.

Comment on lines +426 to +434
- name: Download Windows portable installer
uses: actions/download-artifact@v2
with:
name: win-portable-x86_64
path: win-portable-x86_64
- name: Download Windows x86_64 installer
uses: actions/download-artifact@v2
with:
name: win-installer-x86_64
path: win-installer-x86_64
Copy link
Collaborator

Choose a reason for hiding this comment

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

Action item for later: we have also been including the PDB files with our releases, on the off chance that we need to do a perf investigation with PerfView.

Copy link
Author

Choose a reason for hiding this comment

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

The PDB files included in microsoft/git releases (example) differ from those included in git-for-windows/git releases (example) - it looks like git-for-windows/git includes PDBs for external dependencies as well. Which set should be included here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll defer to @dscho here. I've only needed the PDBs for Git and not the rest. Further, our Azure Pipelines build only generated those PDBs. We should also be able to leverage the PDBs from git-for-windows/git if we ever need to go into those dependencies.

Copy link
Author

Choose a reason for hiding this comment

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

If it's alright with you, I'll open a separate issue for this - minor changes are needed in git-for-windows/build-extra to include the PDBs in the installer (since this is built slightly differently than in the existing Azure DevOps pipeline) .

Copy link
Collaborator

Choose a reason for hiding this comment

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

That works for me. Incremental progress is important.

vdye added 2 commits July 22, 2021 13:54
- sign using Azure-stored certificates & client
- sign on Windows agent via python script
- job skipped if credentials for accessing certificate aren't present
- create release & uploads artifact using Octokit
- use job "if" condition to handle uploading signed *or* unsigned .deb
@vdye
Copy link
Author

vdye commented Jul 26, 2021

@dscho since I can't reply directly to your comment:

Please tag the tip of your branch using a tag name that matches the pattern (e.g. v2.32.0.vfs.0.123) and push to this repository (you should have write permissions). That will give us a test run with a draft release as something we can look at.

Tagged v2.32.0.vfs.0.123 - triggered successful execution of build-git-installers, which created a draft release with the relevant artifacts.

  • Since we will be forward-porting these patches with every rebase to every new Git for Windows version, I think it would make sense to prefix the commit messages with some sort of catchy "area" (and then continue in lower-case as is upstream Git's custom), e.g. "release: create initial Windows installer build".
  • The first five commits are structured really well, I think. The commits starting with ab7655f look a bit like fixups to me. Would you mind squashing those changes into the appropriate commits?

Both of these items are done/addressed

Regarding the secrets, I wonder whether we want to create a new workflow environment and install them there, then protect the environment by adding our team as require reviewer. That way, it is not enough to simply push the tag, but a member of our team has to approve the run, reducing the likelihood of those secrets being leaked inadvertently. In preparation for that, I created the build-git-installers environment (but if we decided that we don't want it, we can always delete that environment later). As far as I understand, all that needs to be done is to add environment: build-git-installers to the jobs (unfortunately, it has to be done individually for every job that requires access to those secrets and cannot be configured on the workflow level, on the upside, this would allow us for finer-grained control where e.g. the ubuntu jobs have no access to the code-signing certificate, but it is probably not worth the effort in our context).

The secrets used in this job were all pre-existing at the repository level and are used in other workflows (git-artifacts.yml & release-apt-get.yml). If we do move the secrets to workflow environments, all of the workflows should probably be changed at once to make it easier to move the credentials - I'll open an issue for it (if you're not opposed to that change being part of a separate pull request).

Add HOME environment to fix code-signing on Windows build
@vdye vdye merged commit 5528db7 into microsoft:vfs-2.32.0 Jul 29, 2021
@vdye vdye deleted the feature/build-installers branch July 29, 2021 20:53
derrickstolee pushed a commit that referenced this pull request Aug 3, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Aug 3, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Aug 5, 2021
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Aug 5, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Aug 9, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Aug 9, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Aug 9, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Aug 12, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Aug 17, 2021
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Oct 30, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Oct 30, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Oct 31, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Nov 4, 2021
Implement workflow to create GitHub release with attached `git` installers
derrickstolee pushed a commit that referenced this pull request Nov 10, 2021
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Aug 8, 2023
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Aug 11, 2023
Implement workflow to create GitHub release with attached `git` installers
jeffhostetler pushed a commit that referenced this pull request Aug 23, 2023
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Nov 3, 2023
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Nov 3, 2023
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Nov 3, 2023
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Nov 8, 2023
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Nov 14, 2023
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Nov 20, 2023
Implement workflow to create GitHub release with attached `git` installers
vdye added a commit that referenced this pull request Feb 27, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Apr 23, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Apr 23, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Apr 23, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Apr 24, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Apr 29, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request May 14, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request May 14, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request May 14, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Jun 3, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Jul 17, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Jul 17, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Jul 17, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Jul 18, 2024
Implement workflow to create GitHub release with attached `git` installers
mjcheetham pushed a commit that referenced this pull request Jul 23, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Jul 25, 2024
Implement workflow to create GitHub release with attached `git` installers
mjcheetham pushed a commit that referenced this pull request Jul 29, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Sep 18, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Sep 24, 2024
Implement workflow to create GitHub release with attached `git` installers
dscho pushed a commit that referenced this pull request Oct 8, 2024
Implement workflow to create GitHub release with attached `git` installers
mjcheetham pushed a commit that referenced this pull request Dec 3, 2024
Implement workflow to create GitHub release with attached `git` installers
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.

3 participants