forked from FreeRTOS/CI-CD-Github-Actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
61 lines (57 loc) · 2.59 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: 'SSL Credential Creator'
description: 'Creates a Root CA private key, a Root CA certificate, a server private key, a server certificate, a device private key, and certificate. These can be used to set up servers with authentication.'
outputs:
root-ca-priv-key-path:
description: "Root CA private key file path."
value: ${{ steps.generate-credentials.outputs.root-ca-priv-key-path }}
root-ca-cert-path:
description: "Root CA certificate file path."
value: ${{ steps.generate-credentials.outputs.root-ca-cert-path }}
server-priv-key-path:
description: "Server private key file path."
value: ${{ steps.generate-credentials.outputs.server-priv-key-path }}
server-cert-path:
description: "Server certificate file path."
value: ${{ steps.generate-credentials.outputs.server-cert-path }}
device-priv-key-path:
description: "Device private key file path."
value: ${{ steps.generate-credentials.outputs.device-priv-key-path }}
device-cert-path:
description: "Device certificate file path."
value: ${{ steps.generate-credentials.outputs.device-cert-path }}
runs:
using: "composite"
steps:
- env:
bashPass: \033[32;1mPASSED -
bashInfo: \033[33;1mINFO -
bashFail: \033[31;1mFAILED -
bashEnd: \033[0m
stepName: Install Dependencies
shell: bash
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
pip install -r $GITHUB_ACTION_PATH/requirements.txt
echo -e "::endgroup::"
echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
- env:
bashPass: \033[32;1mPASSED -
bashInfo: \033[33;1mINFO -
bashFail: \033[31;1mFAILED -
bashEnd: \033[0m
stepName: Generate credentials
id: generate-credentials
shell: bash
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
python3 $GITHUB_ACTION_PATH/ssl_credential_creator.py
echo "root-ca-priv-key-path=$(pwd)/root_ca_priv_key.key" >> $GITHUB_OUTPUT
echo "root-ca-cert-path=$(pwd)/root_ca_cert.crt" >> $GITHUB_OUTPUT
echo "server-priv-key-path=$(pwd)/server_priv_key.key" >> $GITHUB_OUTPUT
echo "server-cert-path=$(pwd)/server_cert.crt" >> $GITHUB_OUTPUT
echo "device-priv-key-path=$(pwd)/device_priv_key.key" >> $GITHUB_OUTPUT
echo "device-cert-path=$(pwd)/device_cert.crt" >> $GITHUB_OUTPUT
echo -e "::endgroup::"
echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"