This repository was archived by the owner on Nov 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (143 loc) · 5.47 KB
/
automatic_cipheros_builder.yml
File metadata and controls
173 lines (143 loc) · 5.47 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Automatic CipherOS Builder
on:
push:
branches:
- main
env:
VERSION: 1.6
jobs:
test-and-build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x64, arm64, x32]
exclude:
- os: windows-latest
arch: arm64
- os: windows-latest
arch: x32
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.13.1'
- name: Install Inno Setup
if: runner.os == 'Windows'
run: |
choco install innosetup -y
shell: cmd
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt pyinstaller
- name: Detect Architecture
run: echo "Running on $RUNNER_OS with architecture $RUNNER_ARCH"
shell: bash
- name: Run Compilation Script
shell: bash
run: |
OUTPUT_DIR="distworkflow"
mkdir -p "$OUTPUT_DIR"
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
echo "Compiling for Windows (${RUNNER_ARCH})..."
pyinstaller main.py --distpath "$OUTPUT_DIR" --onefile --icon="./icon.ico" --name="cipheros"
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
echo "Compiling for Linux (${RUNNER_ARCH})..."
pyinstaller main.py --distpath "$OUTPUT_DIR" --onefile --icon="./icon.ico" --name="${{ matrix.os }}-${{ matrix.arch }}-executeable"
chmod +x $OUTPUT_DIR/${{ matrix.os }}-${{ matrix.arch }}-executeable
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
echo "Compiling for macOS (${RUNNER_ARCH})..."
pyinstaller main.py --distpath "$OUTPUT_DIR" --onefile --icon="./icon.ico" --name="${{ matrix.os }}-${{ matrix.arch }}-executeable"
chmod +x $OUTPUT_DIR/${{ matrix.os }}-${{ matrix.arch }}-executeable
fi
- name: Test Initialization
shell: bash
run: |
EXECUTABLE="distworkflow/${{ matrix.os }}-${{ matrix.arch }}-executeable"
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
EXECUTABLE="distworkflow/cipheros.exe"
fi
if [[ ! -f "$EXECUTABLE" ]]; then
echo "Error: Compiled executable not found!"
exit 1
fi
$EXECUTABLE --debug --startdir=. || (echo "Error: Program failed during initialization!" && exit 1)
- name: Package with Inno Setup
if: runner.os == 'Windows'
run: |
# Detect architecture more reliably
$arch = if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64" -and $env:ProgramFiles -match "x86") { "x32" }
elseif ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { "x64" }
else { "x32" }
# Set the path to the ISS file based on architecture
$issFile = if ($arch -eq "x64") { "installer_x64.iss" } else { "installer_x32.iss" }
# Run the Inno Setup Compiler
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" $issFile
shell: pwsh
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.os }}-${{ matrix.arch }}-build"
path: "distworkflow"
include-hidden-files: true
buildreleasepackage:
runs-on: ubuntu-latest
needs: test-and-build
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download macOS x64 Build Artifacts
uses: actions/download-artifact@v4
with:
name: "macos-latest-x64-build"
- name: Download macOS arm64 Build Artifacts
uses: actions/download-artifact@v4
with:
name: "macos-latest-arm64-build"
- name: Download macOS x32 Build Artifacts
uses: actions/download-artifact@v4
with:
name: "macos-latest-x32-build"
- name: Download Ubuntu x64 Build Artifacts
uses: actions/download-artifact@v4
with:
name: "ubuntu-latest-x64-build"
- name: Download Ubuntu arm64 Build Artifacts
uses: actions/download-artifact@v4
with:
name: "ubuntu-latest-arm64-build"
- name: Download Ubuntu x32 Build Artifacts
uses: actions/download-artifact@v4
with:
name: "ubuntu-latest-x32-build"
- name: Download Windows x64 Build Artifacts
uses: actions/download-artifact@v4
with:
name: "windows-latest-x64-build"
- name: Extract Build Artifacts
run: |
mkdir -p build
tree
for os in ubuntu-latest windows-latest macos-latest; do
for arch in x64 arm64 x32; do
if [[ "$os" == "windows-latest" ]]; then
continue
fi
artifact="${os}-${arch}-executeable"
mv ./${artifact} build
done
done
zip -j windows-latest-x64-build.zip "./cipheros.exe"
mv windows-latest-x64-build.zip build/
mv ./"CipherOS Windows ${{ env.VERSION }} x64.exe" build
- name: Create Release Package for All OS
run: |
zip -r releasebuild.zip build/*
- name: Upload Release Package
uses: actions/upload-artifact@v4
with:
path: ./releasebuild.zip
name: cipheros_release_package