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 GitHub Actions workflows to attach release assets. Fix #427 #616

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

BrianHenryIE
Copy link
Contributor

@BrianHenryIE BrianHenryIE commented Sep 6, 2023

Adds two GitHub Actions workflows, one running MacOS and the other Ubuntu, triggered by new releases, each of which updates the version number and runs swift build --disable-sandbox -c release, zips the file and attaches it to the release.

I'm not sure why it uses --disable-sandbox, I copied that from Iron-Ham/swift-format-linter-action but maybe it's unnecessary?

The MacOS asset also contains disable-codesigning.sh which contains the command xattr -c swift-format because otherwise :

"swift-format" cannot be opened because the developer cannot be verified

Screenshot 2023-09-05 at 4 25 30 PM

While I say fixes #427, rather than trigger on tag, this is triggered on release.

Main isn't building for me so I branched at 508.0.1 and tested on that: https://github.com/BrianHenryIE/swift-format/releases

Screenshot 2023-09-05 at 5 24 33 PM

@allevato
Copy link
Collaborator

allevato commented Sep 6, 2023

I appreciate the effort here, but I believe this repository (and many of Apple's Swift repositories) doesn't have Github Actions enabled (the Actions tab is hidden at the top).

I'd prefer to get swift-ci triggers working directly in this repository, since I currently have to use a fake paired PR in swift-syntax to kickstart it (@shahmishal @ahoppen). I'm not personally privy to the policy decisions around which repositories have Github actions and which don't (the only one I know of without checking is swift-protobuf), but since swift-format is integrated into toolchain builds, at a minimum we do need swift-ci to ensure that swift-format doesn't break any other components.

Once we have that, even if we could use Github actions for other things, I don't know if having to maintain both kinds of checks would be worth the effort.

Copy link
Contributor

@natikgadzhi natikgadzhi left a comment

Choose a reason for hiding this comment

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

@BrianHenryIE, thank you for putting these together! I've had a similar itch + formatting #610.

Similar conversations re: GitHub Actions in apple/swift-org-website: apple/swift-org-website#217 (comment). Most other Apple repos use @swift-ci.

@BrianHenryIE
Copy link
Contributor Author

BrianHenryIE commented Sep 6, 2023

the Actions tab is hidden at the top

Oh, it never occurred to me to check!

I don't know if having to maintain both kinds of checks would be worth the effort.

For the general lint CI step, I think it is valuable to have GitHub Actions running here as documentation for other projects to copy.

For this particular issue, the assets will need to be attached to the release via some GitHub API, so this might be an easy option. I presume to fix the unverified developer warning, a private key would have to be uploaded to GitHub Actions Secrets, and it's probably preferred to keep that inside Apple infrastructure.

I'll take a look at @swift-ci and see what I can learn. I had been planning to write another Action to automatically update the version number (as done in this PR, additionally in the README) and commit to main on new releases.

@jesus-mg-ios
Copy link

Can Xcode Cloud be used to build the binary and notarize it? It could be a simpler and more secure way to do it.

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.

Feature: Generate command line for linux and Mac and even for windows, and publish it on release TAG
4 participants