-
Notifications
You must be signed in to change notification settings - Fork 44
107 lines (87 loc) · 3.58 KB
/
image.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Push installation image
on:
workflow_dispatch:
release:
types: [published]
jobs:
windows-install-purple:
runs-on: windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
path: purple-a11y
- name: Copy scripts to parent directory
run: |
cp ${{github.workspace}}/purple-a11y/scripts/*.ps1 ${{github.workspace}}
cp ${{github.workspace}}/purple-a11y/scripts/*.cmd ${{github.workspace}}
cp ${{github.workspace}}/purple-a11y/scripts/*.xml ${{github.workspace}}
- name: Install Purple dependencies for Windows
shell: pwsh
run: powershell.exe -NoProfile -ExecutionPolicy Bypass "& ${{github.workspace}}\install_purple_dependencies.ps1"
working-directory: ${{github.workspace}}
- name: Zip entire Purple folder (Windows)
shell: pwsh
run: Compress-Archive -Path ${{github.workspace}}/* -DestinationPath purple-a11y-portable-windows.zip
- name: Upload Windows artifact
uses: actions/upload-artifact@v3
with:
name: purple-a11y-portable-windows
path: ./purple-a11y-portable-windows.zip
- name: Release Windows artifact
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
purple-a11y-portable-windows.zip
mac-install-purple:
runs-on: self-hosted
environment: macos
steps:
- name: Clean Workspace Folder
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- name: Check out repository code
uses: actions/checkout@v3
with:
path: purple-a11y
- name: Grant execute permissions for user
run: chmod ugo+rwx ./scripts/*.command ./scripts/*.sh
working-directory: purple-a11y
- name: Copy scripts to parent directory
run: |
cp ./purple-a11y/scripts/{*.command,*.sh,*.xml} ${{ github.workspace }}
- name: Install Purple dependencies for MacOS
run: |
./install_purple_dependencies.command
- name: Sign required binaries for MacOS
run: |
# Find a valid code signing certificate in your keychain for distribution outside Mac App Store
CERTIFICATE=$(security find-identity -v -p codesigning -s - | tail -n +2 | grep -o '"Developer ID Application:[^"]*"' | sed 's/"//g')
# Paths to the binaries you want to sign only ending with .node
BINARIES=($(find . -type f -name "*.node" ! -path "*.framework/*" ! -path "*.dSYM/*"))
# Loop through the binary paths and sign each one with a secure timestamp
for binary in "${BINARIES[@]}"; do
# Check if the binary is already signed
codesign --timestamp -f -s "$CERTIFICATE" "$binary"
if [ $? -eq 0 ]; then
echo "Successfully signed (with secure timestamp): $binary"
else
echo "Failed to sign: $binary"
fi
done
- name: Zip entire Purple folder (Mac)
run: |
zip purple-a11y-portable-mac.zip -y -r ./
- name: Upload Mac artifact
uses: actions/upload-artifact@v3
with:
name: purple-a11y-portable-mac
path: ./purple-a11y-portable-mac.zip
- name: Release Mac artifact
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
purple-a11y-portable-mac.zip