-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (65 loc) · 2.53 KB
/
check-installation.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
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.11
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- 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-$VERSION-arm64.pkg"
else
FILENAME="chirpity-$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 }}."