Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

fix codesign for windows and macos #240

Merged
merged 8 commits into from
Aug 8, 2023
Merged

fix codesign for windows and macos #240

merged 8 commits into from
Aug 8, 2023

Conversation

DaMandal0rian
Copy link
Member

@DaMandal0rian DaMandal0rian commented Jul 25, 2023

This PR:

  • upgrades the skymatic/code-sign-action to v2.0.1 to support x64 arch and newer windows sdk build versions.
  • checks if macOS keychain exists already on the host OS and if not will create it.
  • Use new macOS signing / notarization since altool is deprecated and will be removed in later 2023.

Copy link
Member

@nazar-pc nazar-pc left a comment

Choose a reason for hiding this comment

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

Updating action for Windows signing makes sense, no concerns there.

@@ -113,7 +113,13 @@ jobs:
run: |
echo "Importing certificate"
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12
security create-keychain -p "${{ secrets.MACOS_CERTIFICATE_PASSWORD }}" build.keychain
# Check if the keychain exists
Copy link
Member

Choose a reason for hiding this comment

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

This must not be necessary or else we might leak some keys from one workflow to another. There must be some state sharing here that causes an issue that is not present in GitHub's runners and thus needs to be fixed.

Copy link
Member Author

@DaMandal0rian DaMandal0rian Jul 26, 2023

Choose a reason for hiding this comment

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

I checked the runner and the keychain already exists on the machine, hence why the error "the keychain exists already". What do you propose to do to solve this? What about Apple-Actions/import-codesign-certs#8 (comment) ?

Copy link
Member

Choose a reason for hiding this comment

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

I'm fairly certain it exists because of the command that was ran earlier. I don't know how runners work, but it is expected that every time we have a clean environment with no key chains and nothing in them. Maybe previous workflow run created it, but then something must ensure it doesn't exists anymore after it is over or else, as mentioned above, we're leaking keys.

And we need to check the same for Windows. It may not complain, but keys might still be left in there.

Copy link
Member Author

Choose a reason for hiding this comment

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

The cleanup script should wipe this now after each run for macOS; for windows, it stores it in the path where jobs are ran and cleaned up, so should be fine.

@DaMandal0rian DaMandal0rian marked this pull request as ready for review July 26, 2023 18:44
@DaMandal0rian DaMandal0rian requested a review from nazar-pc July 26, 2023 18:44
Copy link
Member

@nazar-pc nazar-pc left a comment

Choose a reason for hiding this comment

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

Just triggered here: https://github.com/subspace/subspace-cli/actions/runs/5672898609
Let's see how it goes.

Copy link
Member

@nazar-pc nazar-pc left a comment

Choose a reason for hiding this comment

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

Nope, release CI failed

- altool is deprecated and will be dropped in 2023
- altool also not available with xcode command-line tools
- use one protoc package as the bug was fixed with using powershell 7
@DaMandal0rian DaMandal0rian force-pushed the fix-codesign branch 8 times, most recently from a4990ab to 06e442f Compare August 7, 2023 15:35
macOS stapling not supported for .zip files
Copy link
Member

@nazar-pc nazar-pc left a comment

Choose a reason for hiding this comment

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

Makes sense overall. Can you also replace github.github.repository_owner with github.repository_owner in workflows now (it was a typo and the reason why CI was passing before even if signing was failing).

nazar-pc
nazar-pc previously approved these changes Aug 8, 2023
Copy link
Member

@nazar-pc nazar-pc 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 great, thanks!
Was CI not triggered here because only workflow file has changed?

@DaMandal0rian
Copy link
Member Author

This is great, thanks! Was CI not triggered here because only workflow file has changed?

it was triggered but I just cancelled the running, will work on converting it to using homebrew for installation.

@nazar-pc
Copy link
Member

nazar-pc commented Aug 8, 2023

it was triggered but I just cancelled the running, will work on converting it to using homebrew for installation.

I mean I don't see testing/lining in this PR in list of checks. If they were cancelled, it'd show something that failed/was cancelled, but it shows one expected and nothing else.

- use brew instead of downloading releases
@DaMandal0rian DaMandal0rian merged commit 2585544 into main Aug 8, 2023
@DaMandal0rian DaMandal0rian deleted the fix-codesign branch August 8, 2023 15:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants