Mattk70 is installing chirpity #680
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: Test Chirpity Compilation | |
run-name: ${{ github.actor }} is installing chirpity | |
on: [push, workflow_dispatch] | |
jobs: | |
Build-Chirpity: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest] #, ubuntu-latest] | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
steps: | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "🖥️ The workflow is now ready to test your code on the runner." | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.0.x | |
- run: echo "🍏 Node setup status is ${{ job.status }}." | |
# Step to set up Python 3.9 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Python dependencies on macOS | |
if: runner.os == 'macOS' | |
run: brew install [email protected] | |
- name: Install dependencies | |
run: | | |
npm install | |
echo "Install's status is ${{ job.status }}." | |
# Conditional build command for each OS | |
- name: Build Electron application | |
shell: bash | |
run: | | |
if [[ "$RUNNER_OS" == "Windows" ]]; then | |
npx electron-builder --win --x64 | |
elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
npx electron-builder --mac | |
else | |
npx electron-builder build --linux --x64 | |
fi | |
- run: echo "Build status is ${{ job.status }}." | |
- name: Check installer exists | |
shell: bash | |
run: | | |
# Retrieve the version from package.json | |
VERSION=$(jq -r '.version' package.json) | |
# Construct the filename | |
if [[ "$RUNNER_OS" == "Windows" ]]; then | |
FILENAME="chirpity Setup $VERSION.exe" | |
elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
FILENAME="chirpity Setup $VERSION.pkg" | |
else | |
FILENAME="chirpity Setup $VERSION.AppImage" | |
fi | |
# Check if the file exists | |
if [ -f "./dist/$FILENAME" ]; then | |
echo "Executable $FILENAME found in ./dist" | |
else | |
echo "Executable $FILENAME not found in ./dist" && exit 1 | |
fi | |
- run: echo "File check status is ${{ job.status }}." | |