Skip to content

Commit 8d24a84

Browse files
fix: add binary os (#56)
1 parent 4e0f957 commit 8d24a84

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

.github/workflows/ci_cd.yml

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -226,41 +226,45 @@ jobs:
226226
matrix:
227227
os: [windows-latest, ubuntu-latest, macos-latest]
228228
steps:
229-
- name: Checkout code
230-
uses: actions/checkout@v4
229+
- name: Checkout code
230+
uses: actions/checkout@v4
231231

232-
- name: Set up Python
233-
uses: actions/setup-python@v5
234-
with:
235-
python-version: ${{ env.MAIN_PYTHON_VERSION }}
236-
237-
- name: Install dependencies
238-
run: pip install .[all]
239-
240-
- name: Install PyInstaller
241-
run: pip install pyinstaller
242-
243-
- name: Attempt to build executable
244-
id: first-attempt
245-
run: >
246-
pyinstaller src/allie/flowkit/__main__.py --onefile
247-
--name ${{ github.event.repository.name }}-${{ github.ref_name }}
248-
--copy-metadata ${{ github.event.repository.name }} # keep importlib.metadata working
249-
--hidden-import uvicorn --collect-all uvicorn # bring in the runtime server
250-
--distpath build/dist --workpath build/build --specpath build
251-
continue-on-error: true
252-
253-
- name: Modify spec file and retry build
254-
if: steps.first-attempt.outcome == 'failure'
255-
run: |
256-
echo "import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5)" >> ${{ github.event.repository.name }}-${{ github.ref_name }}.spec
257-
pyinstaller ${{ github.event.repository.name }}-${{ github.ref_name }}.spec
258-
259-
- name: Upload artifact
260-
uses: actions/upload-artifact@v4
261-
with:
262-
name: ${{ matrix.os }}-binaries
263-
path: dist/${{ github.event.repository.name }}-*
232+
- name: Set up Python
233+
uses: actions/setup-python@v5
234+
with:
235+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
236+
237+
- name: Install dependencies
238+
run: pip install .[all]
239+
240+
- name: Install PyInstaller
241+
run: pip install pyinstaller
242+
243+
- name: Set OS name
244+
id: os_name
245+
run: echo "os_short=$(echo '${{ matrix.os }}' | sed 's/-latest//')" >> $GITHUB_OUTPUT
246+
247+
- name: Attempt to build executable
248+
id: first-attempt
249+
run: >
250+
pyinstaller src/allie/flowkit/__main__.py --onefile
251+
--name ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ steps.os_name.outputs.os_short }}
252+
--copy-metadata ${{ github.event.repository.name }}
253+
--hidden-import uvicorn --collect-all uvicorn
254+
--distpath build/dist --workpath build/build --specpath build
255+
continue-on-error: true
256+
257+
- name: Modify spec file and retry build
258+
if: steps.first-attempt.outcome == 'failure'
259+
run: |
260+
echo "import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5)" >> ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ steps.os_name.outputs.os_short }}.spec
261+
pyinstaller ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ steps.os_name.outputs.os_short }}.spec
262+
263+
- name: Upload artifact
264+
uses: actions/upload-artifact@v4
265+
with:
266+
name: ${{ matrix.os }}-binaries
267+
path: build/dist/${{ github.event.repository.name }}-*
264268

265269
sign-windows-binary:
266270
name: Sign Windows binary

0 commit comments

Comments
 (0)