Skip to content

Disable code signing when workflows run from forks #208

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

Closed
wants to merge 1 commit into from

Conversation

rsora
Copy link
Contributor

@rsora rsora commented Mar 12, 2021

This PR refactors the CI workflows to be more "fork friendly".
If workflows are run on a PR generated by a fork, where secrets are not available, the CI will run skipping the signing steps, providing unsigned artifacts.

What this PR does:

  • Skip Mac/Win code signing and Apple notarization only if PR comes from a fork
  • Disable workflows entirely if the user enabled Github Actions in
    their fork repo
  • Add steps to help Mac users to test their forked code in BUILDING.md

- Skip Mac/Win code signing and Apple notarization only if PR comes from a fork
- Disable workflows entirely if the user enabled Github Actions in
their fork repo
- Add steps to help Mac users to test their forked code in BUILDING.md
@rsora rsora requested review from per1234 and kittaakos March 12, 2021 08:36
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

I added a few comments here and there. I will accept the PR if you re-submit it from a fork. Otherwise, we cannot verify if it works or not.

From the build logs:

IS_FORK: false

@@ -21,4 +25,4 @@ exports.default = async function notarizing(context) {
appleId: process.env.AC_USERNAME,
appleIdPassword: process.env.AC_PASSWORD,
});
};
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert. The project uses trailing empty lines.

@@ -73,6 +73,22 @@ This project is built on [GitHub Actions](https://github.com/arduino/arduino-ide
git push origin 1.2.3
```

## Notes for macOS contributors
Beginning in macOS 10.14.5, software [must be notarized to run](https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution). The signing and notarization processes for the Arduino IDE are managed by our Continuous Integration (CI) workflows, implemented with GitHub Actions. On every push and pull request, the Arduino IDE is built and saved to a workflow artifact. These artifacts can be used by contributors and beta testers who don't want to set up a build system locally.
Copy link
Contributor

Choose a reason for hiding this comment

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

software -> the software

@@ -73,6 +73,22 @@ This project is built on [GitHub Actions](https://github.com/arduino/arduino-ide
git push origin 1.2.3
```

## Notes for macOS contributors
Beginning in macOS 10.14.5, software [must be notarized to run](https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution). The signing and notarization processes for the Arduino IDE are managed by our Continuous Integration (CI) workflows, implemented with GitHub Actions. On every push and pull request, the Arduino IDE is built and saved to a workflow artifact. These artifacts can be used by contributors and beta testers who don't want to set up a build system locally.
For security reasons, signing and notarization is disabled for workflow runs for pull requests from forks of this repository. This means that macOS will block you from running those artifacts.
Copy link
Contributor

Choose a reason for hiding this comment

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

signing and notarization is -> signing and notarization are

@@ -119,4 +124,4 @@ jobs:
WARNING: ${{ github.repository }} ${{ matrix.certificate.identifier }} will expire in ${{ steps.get-days-before-expiration.outputs.days }} days!!!
:warning::warning::warning::warning:
SLACK_COLOR: danger
MSG_MINIMAL: true
MSG_MINIMAL: true
Copy link
Contributor

Choose a reason for hiding this comment

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

We use empty trailing lines.

Hint: if you edit the code in VS Code, Code will insert the empty line for you one save. Please use Code.

"files.insertFinalNewline": true,

@@ -173,4 +179,4 @@ jobs:
PLUGIN_TARGET: "/arduino-ide"
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing empty line.

@@ -16,6 +16,7 @@ on:
jobs:

build:
if: github.repository == 'arduino/arduino-ide'
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if I understand this condition. Can you please explain?

@rsora
Copy link
Contributor Author

rsora commented Mar 12, 2021

@kittaakos I'll open a new PR from a fork, so we can test the workflow mods I prepared as you requested.
I'll address all your change requests in the new PR and answer to your question there. I'll close this one once we merge the new PR.
Is that ok for you?

@kittaakos
Copy link
Contributor

Is that ok for you?

👍 Thank you!

@rsora
Copy link
Contributor Author

rsora commented Mar 15, 2021

Superseded by #213

@rsora rsora closed this Mar 15, 2021
@kittaakos kittaakos deleted the rsora/fork-build branch April 8, 2021 12:43
@per1234 per1234 added the topic: infrastructure Related to project infrastructure label Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants