|
1 | 1 | # Whenever a release is published from a draft, this will update the
|
2 | 2 | # master Arduino JSON file to add its new entry.
|
3 | 3 |
|
4 |
| -# We keep the master JSON file in another repo, so we need to use a pre-set GH |
5 |
| -# SSH key to be able to push a change to the repo. |
6 |
| - |
7 |
| -# At some point this should really be moved to the main repo to avoid this grief |
| 4 | +# We keep the master JSON file in another repo, so we need to use a pre-set |
| 5 | +# Deployment SSH key to be able to push a change to the repo. |
8 | 6 |
|
9 | 7 | #### Steps to follow when you need to make a new SSH key for upload (not
|
10 | 8 | #### normally needed!)
|
11 | 9 |
|
12 |
| -# We encrypt the id_rda (private key) using a key and IV generated randomly: |
13 |
| -# openssl enc -nosalt -aes-256-cbc -pbkdf2 -k "$(openssl rand -base64 100 | sed s/=//)" -P |
14 |
| -# > key = <long string of hex> |
15 |
| -# > iv = <long string of hex> |
| 10 | +# Generate a new SSH key private/public pair |
16 | 11 |
|
17 |
| -# Set that key and IV strings are set as secrets in the *Arduino repo* GitHub |
18 |
| -# CI Secrets object as GHKEY and GHIV. |
| 12 | +# ssh-keygen -t rsa -b 4096 -C "[email protected]" -f ./deploy_rsa |
19 | 13 |
|
20 |
| -# Now make a SSH key using ssh-keygen (do not use your own, make a new one!) |
21 |
| -# ssh-keygen ... |
| 14 | +# Upload deploy_rsa.pub to the *ESP8266.GITHUB.IO* repo as a deployment key |
22 | 15 |
|
23 |
| -# Upload the id_rsa.pub (public key) to the GH.IO GitHub as a *deploy key* |
24 |
| -# (https://github.com/esp8266/esp8266.github.io->Settings->Deploy Keys->Add Key) |
25 |
| -# DO NOT USE Settings->SSH and GPG Keys->New SSH Key because that allows |
26 |
| -# full access to all repos owned by the user, while a Deploy Key only allows |
27 |
| -# access to a single repo. |
| 16 | +# Convert the private key to base64 (to remove line breaks and allow easier |
| 17 | +# usage in the script as an environment variable) |
28 | 18 |
|
29 |
| -# Encrypt the private part of the key using the key and IV above and commit the change |
30 |
| -# openssl enc -aes-256-cbc -K <key> -iv <iv> -in id_rsa -out package/esp8266_github_io_deploy.enc |
31 |
| -# git add package/esp8266_github_io_deploy.enc |
| 19 | +# base64.exe -w 0 < deploy_rsa > deploy_rsa.b64 |
32 | 20 |
|
| 21 | +# Copy the contents of the .b64 file to the clipboard, make a new GitHub |
| 22 | +# secret in the ESP8266/Arduino repo called "GHCI_DEPLOY_KEY" and paste |
| 23 | +# the B64 code into the variable. |
33 | 24 |
|
34 | 25 | name: ESP8266 Arduino Release Publisher
|
35 | 26 |
|
|
56 | 47 | TRAVIS_BUILD_DIR: ${{ github.workspace }}
|
57 | 48 | BUILD_TYPE: package
|
58 | 49 | CI_GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }}
|
59 |
| - GHKEY: ${{ secrets.GHKEY }} |
60 |
| - GHIV: ${{ secrets.GHIV }} |
| 50 | + GHCI_DEPLOY_KEY: ${{ secrets.GHCI_DEPLOY_KEY }} |
61 | 51 | run: |
|
62 | 52 | bash ./tests/ci/build_package.sh
|
63 | 53 | # Only the regenerated JSON file will be used, but it's simpler
|
|
0 commit comments