forcing python version 3 for macos #34
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: Build Snapshot | |
on: | |
push: | |
branches: | |
- 'development' | |
- 'snapshot/**' | |
jobs: | |
package: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v2 | |
- name: Install Rosetta on macOS (ARM64) | |
if: runner.os == 'macOS' && runner.arch == 'ARM64' | |
run: | | |
softwareupdate --install-rosetta --agree-to-license | |
- name: Setup Node.js (x86_64 through Rosetta on macOS ARM64) | |
if: runner.os == 'macOS' && runner.arch == 'ARM64' | |
run: | | |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://nodejs.org/dist/v14.18.1/node-v14.18.1-darwin-x64.tar.gz | tar -xz)" | |
export PATH=$(pwd)/node-v14.18.1-darwin-x64/bin:$PATH | |
echo "Node.js installed via Rosetta" | |
echo "Node.js version: $(node -v)" | |
echo "Node.js path: $(which node)" | |
- name: Setup Node.js (Standard) | |
if: runner.os != 'macOS' || runner.arch != 'ARM64' | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- name: Get package version | |
uses: actions/github-script@v6 | |
id: version | |
with: | |
script: | | |
return JSON.parse(require('fs').readFileSync('package.json')).version; | |
result-encoding: string | |
- name: Install Dependencies on macOS ARM64 | |
if: runner.os == 'macOS' && runner.arch == 'ARM64' | |
run: | | |
export PATH=$(pwd)/node-v14.18.1-darwin-x64/bin:$PATH | |
echo "Node.js path updated for macOS ARM64" | |
echo "Node.js version being used: $(node -v)" | |
npm install | |
- name: Install Dependencies on Other OS | |
if: runner.os != 'macOS' || runner.arch != 'ARM64' | |
run: | | |
npm install | |
- name: Install Gulp on Mac | |
run: npm install -g gulp | |
if: startsWith(matrix.os, 'mac') | |
- name: Build on macOS ARM64 | |
if: runner.os == 'macOS' && runner.arch == 'ARM64' | |
run: | | |
export NODE_OPTIONS=--openssl-legacy-provider | |
gulp prep-pkg | |
- name: Build on Other OS | |
if: runner.os != 'macOS' || runner.arch != 'ARM64' | |
run: gulp prep-pkg | |
- name: Package Win/Linux | |
run: npm run dist | |
if: startsWith(matrix.os, 'win') || startsWith(matrix.os, 'ubuntu') | |
- name: Package Mac | |
run: PYTHON_PATH=$(which python3) npm run dist | |
if: startsWith(matrix.os, 'mac') | |
- name: Upload Linux Version | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./release/INTO-CPS-Application-${{ steps.version.outputs.result }}.AppImage | |
name: INTO-CPS-Application-SNAPSHOT-v${{ steps.version.outputs.result }}.${{ github.run_number }}-linux_x64.AppImage | |
if: startsWith(matrix.os, 'ubuntu') | |
- name: Upload Windows Version | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./release/INTO-CPS-Application Setup ${{ steps.version.outputs.result }}.exe | |
name: INTO-CPS-Application-SNAPSHOT-v${{ steps.version.outputs.result }}.${{ github.run_number }}-win_x86-Setup.exe | |
if: startsWith(matrix.os, 'windows') | |
- name: Upload Portable Windows Version | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./release/INTO-CPS-Application ${{ steps.version.outputs.result }}.exe | |
name: INTO-CPS-Application-SNAPSHOT-v${{ steps.version.outputs.result }}.${{ github.run_number }}-win_x86-Portable.exe | |
if: startsWith(matrix.os, 'windows') | |
- name: Upload Dmg | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./release/INTO-CPS-Application-${{ steps.version.outputs.result }}.dmg | |
name: INTO-CPS-Application-SNAPSHOT-v${{ steps.version.outputs.result }}.${{ github.run_number }}-darwin_x64.dmg | |
if: startsWith(matrix.os, 'mac') | |
- name: Upload Darwin Zip | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./release/INTO-CPS-Application-${{ steps.version.outputs.result }}-mac.zip | |
name: INTO-CPS-Application-SNAPSHOT-v${{ steps.version.outputs.result }}.${{ github.run_number }}-darwin_x64.zip |