Skip to content

Commit b063f68

Browse files
authored
Merge branch 'main' into versioning-in-landing-pages
2 parents 4271f73 + b569f84 commit b063f68

126 files changed

Lines changed: 1265 additions & 587 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
89.2 KB
Loading

content/actions/guides/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ includeGuides:
4242
- /actions/guides/building-and-testing-java-with-maven
4343
- /actions/guides/building-and-testing-java-with-gradle
4444
- /actions/guides/building-and-testing-java-with-ant
45+
- /actions/guides/installing-an-apple-certificate-on-macos-runners-for-xcode-development
4546
- /actions/guides/publishing-nodejs-packages
4647
- /actions/guides/publishing-java-packages-with-maven
4748
- /actions/guides/publishing-java-packages-with-gradle
@@ -81,6 +82,7 @@ includeGuides:
8182
<!-- {% link_in_list /building-and-testing-java-with-maven %} -->
8283
<!-- {% link_in_list /building-and-testing-java-with-gradle %} -->
8384
<!-- {% link_in_list /building-and-testing-java-with-ant %} -->
85+
<!-- {% link_in_list /installing-an-apple-certificate-on-macos-runners-for-xcode-development %} -->
8486
<!-- {% link_in_list /about-packaging-with-github-actions %} -->
8587
<!-- {% link_in_list /publishing-nodejs-packages %} -->
8688
<!-- {% link_in_list /publishing-java-packages-with-maven %} -->
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: Installing an Apple certificate on macOS runners for Xcode development
3+
intro: 'You can sign Xcode apps within your continuous integration (CI) workflow by installing an Apple code signing certificate on {% data variables.product.prodname_actions %} runners.'
4+
product: '{% data reusables.gated-features.actions %}'
5+
versions:
6+
free-pro-team: '*'
7+
enterprise-server: '>=2.22'
8+
github-ae: '*'
9+
type: 'tutorial'
10+
topics:
11+
- 'CI'
12+
- 'Xcode'
13+
---
14+
15+
{% data reusables.actions.enterprise-beta %}
16+
{% data reusables.actions.enterprise-github-hosted-runners %}
17+
{% data reusables.actions.ae-beta %}
18+
19+
### Introduction
20+
21+
This guide shows you how to add a step to your continuous integration (CI) workflow that installs an Apple code signing certificate and provisioning profile on {% data variables.product.prodname_actions %} runners. This will allow you to sign your Xcode apps for publishing to the Apple App Store, or distributing it to test groups.
22+
23+
### Prerequisites
24+
25+
You should be familiar with YAML and the syntax for {% data variables.product.prodname_actions %}. For more information, see:
26+
27+
- "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)"
28+
- "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions)"
29+
30+
You should have an understanding of Xcode app building and signing. For more information, see the [Apple developer documentation](https://developer.apple.com/documentation/).
31+
32+
### Creating secrets for your certificate and provisioning profile
33+
34+
The signing process involves storing certificates and provisioning profiles, transferring them to the runner, importing them to the runner's keychain, and using them in your build.
35+
36+
To use your certificate and provisioning profile on a runner, we strongly recommend that you use {% data variables.product.prodname_dotcom %} secrets. For more information on creating secrets and using them in a workflow, see "[Encrypted secrets](/actions/reference/encrypted-secrets)."
37+
38+
Create secrets in your repository or organization for the following items:
39+
40+
* Your Apple signing certificate.
41+
42+
- This is your `p12` certificate file. For more information on exporting your signing certificate from Xcode, see the [Xcode documentation](https://help.apple.com/xcode/mac/current/#/dev154b28f09).
43+
44+
- You should convert your certificate to Base64 when saving it as a secret. In this example, the secret is named `BUILD_CERTIFICATE_BASE64`.
45+
46+
- Use the following command to convert your certificate to Base64 and copy it to your clipboard:
47+
48+
```shell
49+
base64 <em>build_certificate</em>.p12 | pbcopy
50+
```
51+
* The password for your Apple signing certificate.
52+
- In this example, the secret is named `P12_PASSWORD`.
53+
54+
* Your Apple provisioning profile.
55+
56+
- For more information on exporting your provisioning profile from Xcode, see the [Xcode documentation](https://help.apple.com/xcode/mac/current/#/deva899b4fe5).
57+
58+
- You should convert your provisioning profile to Base64 when saving it as a secret. In this example, the secret is named `BUILD_PROVISION_PROFILE_BASE64`.
59+
60+
- Use the following command to convert your provisioning profile to Base64 and copy it to your clipboard:
61+
62+
```shell
63+
base64 <em>provisioning_profile.mobileprovision</em> | pbcopy
64+
```
65+
66+
* A keychain password.
67+
68+
- A new keychain will be created on the runner, so the password for the new keychain can be any new random string. In this example, the secret is named `KEYCHAIN_PASSWORD`.
69+
70+
### Add a step to your workflow
71+
72+
This example workflow includes a step that imports the Apple certificate and provisioning profile from the {% data variables.product.prodname_dotcom %} secrets, and installs them on the runner.
73+
74+
{% raw %}
75+
```yaml{:copy}
76+
name: App build
77+
on: push
78+
79+
jobs:
80+
build_with_signing:
81+
runs-on: macos-latest
82+
83+
steps:
84+
- name: Checkout repository
85+
uses: actions/checkout@v2
86+
- name: Install the Apple certificate and provisioning profile
87+
env:
88+
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
89+
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
90+
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
91+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
92+
run: |
93+
# create variables
94+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
95+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
96+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
97+
98+
# import certificate and provisioning profile from secrets
99+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
100+
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
101+
102+
# create temporary keychain
103+
security create-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
104+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
105+
security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
106+
107+
# import certificate to keychain
108+
security import $CERTIFICATE_PATH -P $P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
109+
security list-keychain -d user -s $KEYCHAIN_PATH
110+
111+
# apply provisioning profile
112+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
113+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
114+
- name: Build app
115+
...
116+
```
117+
{% endraw %}
118+
119+
### Required clean-up on self-hosted runners
120+
121+
{% data variables.product.prodname_dotcom %}-hosted runners are isolated virtual machines that are automatically destroyed at the end of the job execution. This means that the certificates and provisioning profile used on the runner during the job will be destroyed with the runner when the job is completed.
122+
123+
On self-hosted runners, the `$RUNNER_TEMP` directory is cleaned up at the end of the job execution, but the keychain and provisioning profile might still exist on the runner.
124+
125+
If you use self-hosted runners, you should add a final step to your workflow to help ensure that these sensitive files are deleted at the end of the job. The workflow step shown below is an example of how to do this.
126+
127+
{% raw %}
128+
```yaml
129+
- name: Clean up keychain and provisioning profile
130+
if: ${{ always() }}
131+
run: |
132+
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
133+
rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision
134+
```
135+
{% endraw %}

content/actions/reference/environment-variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ We strongly recommend that actions use environment variables to access the files
5454
| `GITHUB_WORKFLOW` | The name of the workflow. |
5555
| `GITHUB_RUN_ID` | {% data reusables.github-actions.run_id_description %} |
5656
| `GITHUB_RUN_NUMBER` | {% data reusables.github-actions.run_number_description %} |
57+
| `GITHUB_JOB` | The [job_id](/actions/reference/workflow-syntax-for-github-actions#jobsjob_id) of the current job. |
5758
| `GITHUB_ACTION` | The unique identifier (`id`) of the action. |
5859
| `GITHUB_ACTIONS` | Always set to `true` when {% data variables.product.prodname_actions %} is running the workflow. You can use this variable to differentiate when tests are being run locally or by {% data variables.product.prodname_actions %}.
5960
| `GITHUB_ACTOR` | The name of the person or app that initiated the workflow. For example, `octocat`. |

content/actions/reference/environments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ versions:
1616
You can configure environments with protection rules and secrets. When a workflow job references an environment, the job won't start until all of the environment's protection rules pass. A job also cannot access secrets that are defined in an environment until all the environment protection rules pass.
1717

1818
{% if currentVersion == "free-pro-team@latest" %}
19-
Environment protection rules and environment secrets are only available on public repositories. If you convert a repository from public to private, any configured protection rules or environment secrets will be ignored, and you will not be able to configure any environments. If you convert your repository back to public, you will have access to any previously configured protection rules and environment secrets.
19+
Environment protection rules and environment secrets are only available on public repositories and private repositories on an enterprise plan. If you convert a repository from public to private on a non-enterprise plan, any configured protection rules or environment secrets will be ignored, and you will not be able to configure any environments. If you convert your repository back to public, you will have access to any previously configured protection rules and environment secrets.
2020
{% endif %}
2121

2222
#### Environment protection rules

content/admin/enterprise-management/about-geo-replication.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Geo DNS, such as [Amazon's Route 53 service](http://docs.aws.amazon.com/Route53/
2222

2323
Writing requests to the replica requires sending the data to the primary and all replicas. This means that the performance of all writes are limited by the slowest replica, although new geo-replicas can seed the majority of their data from existing co-located geo-replicas, rather than from the primary. Geo-replication will not add capacity to a {% data variables.product.prodname_ghe_server %} instance or solve performance issues related to insufficient CPU or memory resources. If the primary appliance is offline, active replicas will be unable to serve any read or write requests.
2424

25+
{% data reusables.enterprise_installation.replica-limit %}
26+
2527
### Monitoring a geo-replication configuration
2628

2729
{% data reusables.enterprise_installation.monitoring-replicas %}

content/admin/enterprise-management/about-high-availability-configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ When you configure high availability, there is an automated setup of one-way, as
1414

1515
{% data variables.product.prodname_ghe_server %} supports an active/passive configuration, where the replica appliance runs as a standby with database services running in replication mode but application services stopped.
1616

17+
{% data reusables.enterprise_installation.replica-limit %}
18+
1719
### Targeted failure scenarios
1820

1921
Use a high availability configuration for protection against:

content/admin/enterprise-management/creating-a-high-availability-replica.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ topics:
1010
- enterprise
1111
---
1212

13+
{% data reusables.enterprise_installation.replica-limit %}
14+
1315
### Creating a high availability replica
1416

1517
1. Set up a new {% data variables.product.prodname_ghe_server %} appliance on your desired platform. The replica appliance should mirror the primary appliance's CPU, RAM, and storage settings. We recommend that you install the replica appliance in an independent environment. The underlying hardware, software, and network components should be isolated from those of the primary appliance. If you are a using a cloud provider, use a separate region or zone. For more information, see ["Setting up a {% data variables.product.prodname_ghe_server %} instance"](/enterprise/{{ currentVersion }}/admin/guides/installation/setting-up-a-github-enterprise-server-instance).

content/admin/user-management/customizing-user-messages-for-your-enterprise.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,21 @@ You can use Markdown to format your message. For more information, see "[About w
6464
{% if currentVersion ver_gt "enterprise-server@2.22" or currentVersion == "github-ae@latest" %}
6565
### Creating a mandatory message
6666

67-
You can create a mandatory message that {% data variables.product.product_name %} will show to all users the first time they sign in after you save the message. The message appears in a pop-up window that the user must dismiss before the user can use {% data variables.product.product_location %}. Mandatory messages have a variety of uses.
67+
You can create a mandatory message that {% data variables.product.product_name %} will show to all users the first time they sign in after you save the message. The message appears in a pop-up window that the user must dismiss before the user can use {% data variables.product.product_location %}.
68+
69+
Mandatory messages have a variety of uses.
6870

6971
- Providing onboarding information for new employees
7072
- Telling users how to get help with {% data variables.product.product_location %}
7173
- Ensuring that all users read your terms of service for using {% data variables.product.product_location %}
7274

75+
{% note %}
76+
77+
**Note:** After you configure a mandatory message for {% data variables.product.product_location %}, you cannot change or remove the message.
78+
79+
{% endnote %}
80+
81+
7382
If you include Markdown checkboxes in the message, all checkboxes must be selected before the user can dismiss the message. For example, if you include your terms of service in the mandatory message, you can require that each user selects a checkbox to confirm the user has read the terms.
7483

7584
Each time a user sees a mandatory message, an audit log event is created. The event includes the version of the message that the user saw. For more information see "[Audited actions](/admin/user-management/audited-actions)."

content/code-security/secure-coding/configuring-code-scanning.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,22 @@ Scanning code when someone pushes a change, and whenever a pull request is creat
5151

5252
By default, the {% data variables.product.prodname_codeql_workflow %} uses the `on.push` event to trigger a code scan on every push to the default branch of the repository and any protected branches. For {% data variables.product.prodname_code_scanning %} to be triggered on a specified branch, the workflow must exist in that branch. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#on)."
5353

54+
If you scan on push, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)."
55+
56+
{% note %}
57+
58+
**Note**: If you want {% data variables.product.prodname_code_scanning %} alerts to appear as pull request checks, you must use the `pull_request` event, described below.
59+
60+
{% endnote %}
61+
5462
#### Scanning pull requests
5563

5664
The default {% data variables.product.prodname_codeql_workflow %} uses the `pull_request` event to trigger a code scan on pull requests targeted against the default branch. {% if currentVersion ver_gt "enterprise-server@2.21" %}The `pull_request` event is not triggered if the pull request was opened from a private fork.{% else %}If a pull request is from a private fork, the `pull_request` event will only be triggered if you've selected the "Run workflows from fork pull requests" option in the repository settings. For more information, see "[Disabling or limiting {% data variables.product.prodname_actions %} for a repository](/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository#enabling-workflows-for-private-repository-forks)."{% endif %}
5765

5866
For more information about the `pull_request` event, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags)."
5967

68+
If you scan pull requests, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)."
69+
6070
#### Avoiding unnecessary scans of pull requests
6171

6272
You might want to avoid a code scan being triggered on specific pull requests targeted against the default branch, irrespective of which files have been changed. You can configure this by specifying `on:pull_request:paths-ignore` or `on:pull_request:paths` in the {% data variables.product.prodname_code_scanning %} workflow. For example, if the only changes in a pull request are to files with the file extensions `.md` or `.txt` you can use the following `paths-ignore` array.

0 commit comments

Comments
 (0)