ci: Fix mac release for v3.4 #82
Workflow file for this run
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: 🚀 Release | |
# Runs the build and package scripts when a new tagged release is created | |
# Note that this runs for both releases and pre-releases: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release | |
# on: | |
# release: | |
# types: created | |
on: pull_request | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
jobs: | |
package-and-upload: | |
name: Package and Upload | |
runs-on: ${{ matrix.os }} | |
# Run build script for [home/clinic] in [windows/macOS/ubuntu] | |
strategy: | |
matrix: | |
# os: [windows-latest, macOS-latest, ubuntu-latest] | |
os: [windows-latest, macos-13, ubuntu-latest] | |
setting: [home, clinic] | |
# fail-fast: true | |
fail-fast: false | |
steps: | |
# Set up runner | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
- name: ⎔ Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: 🐍 Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
# python-version: "3.10" | |
python-version: 3.12 | |
# Install dependencies and set up environment | |
- name: 🅿️ Install Python tools | |
run: pip install setuptools | |
- name: 📥 Install Dependencies | |
run: npm ci | |
# Set up the environment | |
- name: 🔃 Load .env file (.env.${{matrix.setting}}) | |
uses: xom9ikk/dotenv@v2 | |
with: | |
path: ./env | |
mode: ${{matrix.setting}} | |
# # Build the app | |
# TODO: It looks like electron-forge builds for us? | |
# - name: ⚒ Build | |
# run: npm run build | |
# Package the app installers | |
- name: 📦 Package app installer - Windows | |
if: startsWith(matrix.os, 'windows') | |
run: npm run package:windows | |
- name: 📦 Package app installer - Mac | |
if: startsWith(matrix.os, 'mac') | |
run: npm run package:mac | |
- name: 📦 Package app installer - Linux | |
if: startsWith(matrix.os, 'ubuntu') | |
run: npm run package:linux | |
# Get package info | |
- name: Get package name and version | |
id: package_info | |
run: | | |
echo "name=$(cat package.json | jq -r '.name')" >> $GITHUB_OUTPUT | |
echo "version=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT | |
shell: bash | |
# Upload installers to GitHub release | |
- name: ⬆ Upload installer to release - Windows | |
if: startsWith(matrix.os, 'windows') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: out/make/squirrel.windows/x64/${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }} Setup.exe | |
asset_name: ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-${{ matrix.setting }}-setup.exe | |
tag: ${{ github.ref }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: ⬆ Upload installer to release - macOS | |
if: startsWith(matrix.os, 'mac') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: out/make/${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-universal.dmg | |
asset_name: ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-${{ matrix.setting }}-universal.dmg | |
tag: ${{ github.ref }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: ⬆ Upload installer to release - Linux | |
if: startsWith(matrix.os, 'ubuntu') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: out/make/deb/x64/${{ steps.package_info.outputs.name }}_${{ steps.package_info.outputs.version }}_amd64.deb | |
asset_name: ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-${{ matrix.setting }}-amd64.deb | |
tag: ${{ github.ref }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-gh-pages: | |
name: Deploy to GH Pages | |
runs-on: ubuntu-latest | |
steps: | |
# Set up runner | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
- name: ⎔ Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: 🐍 Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
# Install dependencies | |
- name: 📥 Install Dependencies | |
run: npm ci | |
# Build the app | |
- name: ⚒ Build | |
run: npm run build | |
# Deploy the app to GitHub Pages | |
- name: 🚀 Deploy to GH Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build | |
package-psiturk: | |
name: Package for PsiTurk | |
runs-on: ubuntu-latest | |
steps: | |
# Set up runner | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
- name: ⎔ Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: 🐍 Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
# Install dependencies | |
- name: 📥 Install Dependencies | |
run: npm ci | |
- name: 📥 Install PsiTurk | |
run: pip install psiturk | |
# Build the app | |
- name: ⚒ Build | |
run: npm run build | |
# Get package info | |
- name: Get package name and version | |
id: package_info | |
run: | | |
echo "name=$(cat package.json | jq -r '.name')" >> $GITHUB_OUTPUT | |
echo "version=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT | |
shell: bash | |
# Package with PsiTurk | |
- name: 📦 Create Psiturk Build | |
run: | | |
cd psiturkit | |
./psiturk-it -p ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-psiturk | |
# Zip and upload the package | |
- name: Zip psiturk folder | |
run: | | |
cd psiturkit | |
zip -r ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-psiturk.zip ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-psiturk | |
- name: ⬆ Upload PsiTurk Build | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: psiturkit/${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-psiturk.zip | |
tag: ${{ github.ref }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} |