homerchen19 / github-file-icons

šŸŒˆ šŸ—‚ A browser extension which gives different filetypes different icons to GitHub, GitLab, gitea and gogs.
https://chrome.google.com/webstore/detail/file-icon-for-github-and/ficfmibkjjnpogdcfhfokmihanoldbfe
MIT License
1.41k stars 67 forks source link

added safari extension build #119

Closed christopherpickering closed 2 years ago

christopherpickering commented 2 years ago

Thanks for the extension :)

This PR is to add the files needed for the safari extension build. Thanks to https://github.com/ptrkcsk in #13.

The files (modified to hopefully work in a public signed download) are now included in the safari folder.

Here's an install. Download and move into applications, then run.

(non notarized): File Icons for GitHub and GitLab.app.zip

Let me know if the notarized one works for you - that is the one that is supposed to pass the apple security checks.

The build is updated with

npm build
npm pack:safari
Then publish in Xcode (Images for manual steps): ![image](https://user-images.githubusercontent.com/17788706/175361968-791870c2-f330-48bc-a031-72aa30b65db1.png) ![image](https://user-images.githubusercontent.com/17788706/175362021-a0f145fc-ccf6-43ab-8486-b9c29aabe0cd.png) ![image](https://user-images.githubusercontent.com/17788706/175362051-0af3472c-1c5d-4de3-9da4-1f071ab1e476.png) Choose Notorize. After getting an email back about notarizing, you see this: ![image](https://user-images.githubusercontent.com/17788706/175362097-ab40ba14-1dd3-49a7-9d65-405f6cd343f3.png) Somehow, clicking export here made an unsigned version. So I went back, and clicked export copy. ![image](https://user-images.githubusercontent.com/17788706/175362222-96efa54b-07ca-4456-8180-6779b81d7a75.png)
christopherpickering commented 2 years ago

I tested out making a GitHub action to build the extension for safari and it seems to work well. Here's a successful action run: https://github.com/christopherpickering/github-file-icons/actions/runs/2551948841 and the action script https://github.com/christopherpickering/github-file-icons/blob/8cfe8ac1462c65dee13932068951cf02f7f00afc/.github/workflows/safari.yaml

It has a few repo secrets with the developer signing key I bought from apple.

The trickiest part will be updating the version number.

It looks like the GitHub releases aren't really used here. I'm wondering if it would be helpful to use semantic release, which can do a GitHub release, but also run the workflow, passing in the new version number.

What do you think?

homerchen19 commented 2 years ago

Hi @christopherpickering thanks for your help. I somehow can't make it work. Could you teach me how to load it on Safari?

Steps:

  1. Download the notarized file
  2. Open the app and see "Quit and Open Safari Extensions Preferences"
  3. Click that button, but it doesn't seem to do anything for me. Is that expected?
  4. So I open Safari and select "Safari > Preferences > Extensions", but there is nothing
Screen Shot 2022-06-24 at 10 23 00
homerchen19 commented 2 years ago

Other questions:

  1. I decided to choose yarn.lcok over package-lock.json, so you don't need to create package-lock.json. Btw, if package.json isn't modified, yarn.lock shouldn't be modified either šŸ¤”
  2. Does the /safari generated by npm pack:safari? I have to run it before publishing a new version right?

It looks like the GitHub releases aren't really used here. I'm wondering if it would be helpful to use semantic release, which can do a GitHub release, but also run the workflow, passing in the new version number.

Sorry I don't quite get this. I should create a new release on GitHub every time I release a new version right? Does it resolve the issue?

christopherpickering commented 2 years ago

Hey @homerchen19 thanks!

  1. Click that button, but it doesn't seem to do anything for me. Is that expected?

Right now it only runs from the application folder. The notarized one is deff not working, so I will remove it for now. When it comes back from the notarizing, only the outer application is signed, not the actual extension. I'll play around with that more. The notarizing doesn't remove any of the security popups, it just tells you that apple looked at the code and it "didn't appear malicious." I'm thinking it is only running from the application folder because of the build settings I used: image

I haven't done this before :) I'll look around to see how to make it run from wherever it downloads. But for the one above, put it in your applications folder.

1., 2.

Ops sorry, I can remove the package lock and use yarn, I didn't notice that. The /safari is always going to be there now. The npm pack:safari does a build so you can run directly from Xcode, (like in issue #13, except it is always existing now). The actual command I'm using to build from an action are slightly different.

Releases

That would be the easiest, I can get the release version from GitHub and use that in the build. I'm guessing the Chrome extension is manually build?

christopherpickering commented 2 years ago

https://developer.apple.com/forums/thread/675233 Is why the notarized app didn't work - if I notarize it sounds like it has to come from the App Store.

https://developer.apple.com/forums/thread/667859

christopherpickering commented 2 years ago

I converted back to a draft to finish a few things:

  1. I'm updating the Xcode build script for the action to do notarizing and send to the App Store
  2. I submitted to the App Store, waiting for them to approve the app so we can use a pipeline šŸ¤žšŸ½
  3. I will clean up the files in this pr after hearing back from apple

I'm thinking there will be 2 builds >

  1. unnotarized that can be downloaded from GitHub
  2. notarized that can be downloaded on the appstore
christopherpickering commented 2 years ago

Contrary to all the horror stories I read about adding apps the the store... they approved it in < 12 hrs šŸ˜€

https://apps.apple.com/app/file-icons-for-github/id1631366167

I'll clean up this pr next week.

homerchen19 commented 2 years ago

Nice! It works for me!

Screen Shot 2022-06-26 at 14 13 06

I think you should also put the link on README, and please put your name too! Special thanks your support.

christopherpickering commented 2 years ago

@homerchen19 I still didn't get a script working to auto deploy to the App Store. Even if I did, I still have to go on the website to approve it after loading. It only takes a few seconds to do the Xcode build and send up so I will leave that as is for now. I'm watching the repo, next time you do a release I will update the App Store.

I also updated the readme, does it look ok?

I'm also trying to publish a new version on the app stored with better screenshots, and changed the name to "GitHub File Icons" to match this repo. The name on chrome and Firefox is too long for the App Store, they limit to 30 chars.

Thanks!

homerchen19 commented 2 years ago

I just released v1.3.0. Would you give it a try?

I also updated the readme, does it look ok? It looks awesome thank you!

christopherpickering commented 2 years ago

Yeah, I'll rebase and put and update šŸ‘šŸ½

christopherpickering commented 2 years ago

I submitted to the App Store, It takes them like 8 hrs to release it.. should be good in a few hrs. This is ready to merge if it looks ok to you. If any other tweaks come up I can do a new pr. If its possible, when you do a release can you add notes in it of what is changed? Then I can just copy/paste to the appstore change log instead of reading the commits šŸ˜…

homerchen19 commented 2 years ago

ok, so let me clear my head. Is pack:safari is only for development? Do I need to regenerate those code after releasing a new version? If those code are generated and only for development, do we have to put them in git?

christopherpickering commented 2 years ago

Yes, the pack:safari is for development, I can remove it for now as I'm manually doing the build in safari. I think there is nothing on your end to do in a new release.

For me, I do:

  1. clone
  2. npm run build
  3. Xcode: update build# and version#
  4. Xcode : build
  5. Xcode : archive
  6. Xcode : upload archive
  7. appstoreconnect.apple.com : manually create new appstore release

Everything needed for the Xcode build is now included in the /safari folder on this repo.

homerchen19 commented 2 years ago

Got it. I think we can keep that command, but I guess /safari is not needed to be included in git? Probly we can add it to .gitignore

christopherpickering commented 2 years ago

Well, the /safari is needed for sure, that is the extension package for apple. It has everything Xcode needs to build the extension. It picks up everything from the /build folder after you run npm run build.

christopherpickering commented 2 years ago

Steps 3-6 are automatable, but I didn't get a working script yet. One day I will complete it :) For now, it is literally 1-2 mins in Xcode.

homerchen19 commented 2 years ago

oh so the /safari is not like a build result. The code in /safari doesn't need to be changed right?

christopherpickering commented 2 years ago

Correct šŸ‘šŸ½ Thanks!