Skip to content

Switch to GitHub Actions 🚀 #338

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

Merged
merged 31 commits into from
Jan 7, 2021
Merged

Switch to GitHub Actions 🚀 #338

merged 31 commits into from
Jan 7, 2021

Conversation

dennisameling
Copy link
Contributor

@dennisameling dennisameling commented Nov 27, 2020

Closes #337
CC @niik, this builds further on https://github.com/desktop/dugite-native/tree/actions

This PR does the following:

  • Enable set -eu -o pipefail on the build scripts (this surfaced some bugs in the scripts 🚀)
  • Turn off Travis + AppVeyor
  • Run the build scripts on the respective platforms (Linux/Windows/MacOS)
  • Create GH release when a new tag is created and upload release assets (only when all builds have finished successfully)

Please check carefully whether this mimics all functionality from Travis/AppVeyor.

Example release run: https://github.com/dennisameling/dugite-native/runs/1463719613?check_suite_focus=true
Example release: https://github.com/dennisameling/dugite-native/releases/tag/v2.99.3-test

@dennisameling dennisameling changed the title Switch to GitHub Actions Switch to GitHub Actions 🚀 Nov 27, 2020
github-token: ${{secrets.GITHUB_TOKEN}}
# Workaround since actions/upload-release-asset doesn't support wilcard paths
script: |
const script = require(`${process.env.GITHUB_WORKSPACE}/script/create-release.js`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created a release assets script by taking inspiration from actions/upload-release-asset#47 (comment) 🤓

tag_name: ${{ github.ref }}
release_name: Git ${{ github.ref }}
body: |
TODO add release notes
Copy link
Contributor Author

@dennisameling dennisameling Nov 27, 2020

Choose a reason for hiding this comment

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

Could add generate-release-notes.ts here, what do you think? Probably needs some tweaks to work correctly with the CI pipeline. Or would you like to keep this as a manual step as per https://github.com/desktop/dugite-native/blob/master/docs/releases.md?

UPDATE: I noticed the script looks for the latest draft release. Then it's easy; we could add this script to the very end of the CI release pipeline and ensure we pass the GITHUB_TOKEN (automatically created by GH Actions) AFAIK

Copy link
Member

Choose a reason for hiding this comment

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

I think we should rewrite generate-release-notes.ts to work exclusively on the artifacts from the build job instead of caring about the GitHub release. I don't see much value (other than it being less work probably) of having it operate on the release using the API.

Let me know if you want me to work on rewriting the script, you've already put so much effort into this so I can understand if you don't want to rewrite our legacy scripts as well 😛

Copy link
Contributor Author

@dennisameling dennisameling Nov 27, 2020

Choose a reason for hiding this comment

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

@niik how does this sound: if I make a start on rewriting the script, would you mind having a quick look at desktop/desktop#9691 (comment)? That would make me and many others very happy 😉 Also willing to help with MacOS arm64

Copy link
Member

@niik niik left a comment

Choose a reason for hiding this comment

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

This is spectacular (not to mention fast) work @dennisameling, thank you so much! Really looking forward to getting this merged! I had a few comments to start this off but overall this looks great.

tag_name: ${{ github.ref }}
release_name: Git ${{ github.ref }}
body: |
TODO add release notes
Copy link
Member

Choose a reason for hiding this comment

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

I think we should rewrite generate-release-notes.ts to work exclusively on the artifacts from the build job instead of caring about the GitHub release. I don't see much value (other than it being less work probably) of having it operate on the release using the API.

Let me know if you want me to work on rewriting the script, you've already put so much effort into this so I can understand if you don't want to rewrite our legacy scripts as well 😛

@dennisameling
Copy link
Contributor Author

@niik since we're very close to December 31st (travis-ci.org shutdown), I decided to rework the release notes generation script. Currently waiting for CI to finish a test release on my fork, fingers crossed 🤞🏼 (there's been a massive queue of macOS jobs on GH Actions recently, so that's slowing things down)

@dennisameling dennisameling requested a review from niik December 23, 2020 16:45
@dennisameling
Copy link
Contributor Author

Okay this should be good to go now. Release notes generation is included 🎉

Example run: https://github.com/dennisameling/dugite-native/runs/1601197790?check_suite_focus=true
Example release: https://github.com/dennisameling/dugite-native/releases/tag/v2.99.8-test

Let me know if there's anything else you'd like me to add/change @niik 👍🏼

@niik
Copy link
Member

niik commented Jan 7, 2021

Okay this should be good to go now. Release notes generation is included 🎉

Thank you so so much @dennisameling. We're super grateful. We'll put this to the test next week when we're planning on doing another dugite-native release.

@niik niik merged commit 2e30ac4 into desktop:master Jan 7, 2021
@dscho
Copy link

dscho commented Jan 13, 2021

Any idea why AppVeyor still thinks it should run? https://ci.appveyor.com/project/github-windows/dugite-native/builds/37157173

@niik
Copy link
Member

niik commented Jan 14, 2021

Any idea why AppVeyor still thinks it should run? https://ci.appveyor.com/project/github-windows/dugite-native/builds/37157173

Ah, probably because I forgot to disable the webhook 🤦 Thanks for the tip, should be sorted now!

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.

Move to GitHub Actions
3 participants