Push installation image #200
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -perm +111 -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 | |
if codesign -v "$binary" &>/dev/null; then | |
echo "Already signed: $binary" | |
else | |
codesign --timestamp -s "$CERTIFICATE" "$binary" | |
if [ $? -eq 0 ]; then | |
echo "Successfully signed (with secure timestamp): $binary" | |
else | |
echo "Failed to sign: $binary" | |
fi | |
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 |