|
37 | 37 | python -m pip install wheel pyinstaller |
38 | 38 | pip install -r requirements.txt |
39 | 39 |
|
40 | | - - name: Create .env file for backend |
41 | | - run: | |
42 | | - echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> backend/.env |
43 | | -
|
44 | | - - name: Extract tag name |
45 | | - id: get_version |
46 | | - shell: pwsh |
47 | | - run: | |
48 | | - $version = "${env:GITHUB_REF}" -replace 'refs/tags/', '' |
49 | | - echo "VERSION=$version" >> $env:GITHUB_OUTPUT |
50 | | -
|
51 | | - - name: Create .env file for frontend |
52 | | - run: | |
53 | | - echo NEXT_PUBLIC_REACT_APP_VERSION=${{ steps.get_version.outputs.VERSION }} >> frontend/.env |
54 | | -
|
55 | | - - name: Build the Frontend |
56 | | - shell: pwsh |
57 | | - run: | |
58 | | - $ErrorActionPreference = "Stop" |
59 | | -
|
60 | | - Write-Host "=== Starting build process ===" |
61 | | -
|
62 | | - # Build Next.js app |
63 | | - Write-Host "Building Next.js app..." |
64 | | - cd frontend |
65 | | - npm install |
66 | | - npm run build |
67 | | -
|
68 | | - Write-Host "=== Preparing static files ===" |
69 | | - # Clean and create static directory |
70 | | - if (Test-Path -Path "../backend/static") { |
71 | | - Remove-Item -Recurse -Force ../backend/static |
72 | | - } |
73 | | - New-Item -ItemType Directory -Force -Path ../backend/static |
74 | | -
|
75 | | - # Copy the exported Next.js app to Flask static directory |
76 | | - Write-Host "Copying files to static directory..." |
77 | | - Copy-Item -Recurse -Force out/* ../backend/static/ |
78 | | -
|
79 | | - # Verify the copy |
80 | | - Write-Host "=== Verifying static files ===" |
81 | | - if (-not (Test-Path -Path "../backend/static/index.html")) { |
82 | | - Write-Host "ERROR: index.html not found in static directory!" |
83 | | - exit 1 |
84 | | - } |
85 | | -
|
86 | | - Write-Host "Contents of static directory:" |
87 | | - Get-ChildItem -Path ../backend/static |
88 | | -
|
89 | | - Write-Host "=== Build complete ===" |
90 | | -
|
91 | 40 | - name: Build Windows Executable |
92 | 41 | run: | |
93 | 42 | .\venv\Scripts\activate |
@@ -145,57 +94,6 @@ jobs: |
145 | 94 | python -m pip install pyinstaller |
146 | 95 | pip install -r requirements.txt |
147 | 96 |
|
148 | | - - name: Create .env file for backend |
149 | | - run: | |
150 | | - echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> backend/.env |
151 | | -
|
152 | | - - name: Extract tag name |
153 | | - id: get_version |
154 | | - run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT |
155 | | - |
156 | | - - name: Create .env file for frontend |
157 | | - run: | |
158 | | - echo "NEXT_PUBLIC_REACT_APP_VERSION=${{ steps.get_version.outputs.VERSION }}" >> frontend/.env |
159 | | -
|
160 | | - - name: Build the Frontend |
161 | | - run: | |
162 | | - set -e |
163 | | -
|
164 | | - echo "=== Starting build process ===" |
165 | | -
|
166 | | - # Build Next.js app |
167 | | - echo "Building Next.js app..." |
168 | | - cd frontend |
169 | | - npm install |
170 | | - npm run build |
171 | | -
|
172 | | - echo "=== Preparing static files ===" |
173 | | - # Clean and create static directory |
174 | | - rm -rf ../backend/static |
175 | | - mkdir -p ../backend/static |
176 | | -
|
177 | | - # Copy the exported Next.js app to Flask static directory |
178 | | - echo "Copying files to static directory..." |
179 | | - cp -rv out/* ../backend/static/ |
180 | | -
|
181 | | - # Ensure proper permissions |
182 | | - echo "Setting permissions..." |
183 | | - chmod -R 755 ../backend/static |
184 | | - find ../backend/static -type f -exec chmod 644 {} \; |
185 | | - find ../backend/static -type d -exec chmod 755 {} \; |
186 | | -
|
187 | | - # Verify the copy |
188 | | - echo "=== Verifying static files ===" |
189 | | - if [ ! -f "../backend/static/index.html" ]; then |
190 | | - echo "ERROR: index.html not found in static directory!" |
191 | | - exit 1 |
192 | | - fi |
193 | | -
|
194 | | - echo "Contents of static directory:" |
195 | | - ls -la ../backend/static |
196 | | -
|
197 | | - echo "=== Build complete ===" |
198 | | -
|
199 | 97 | - name: Build MacOS App |
200 | 98 | run: | |
201 | 99 | source venv/bin/activate |
|
0 commit comments