Packaging triggered by RamiAwar #52
Workflow file for this run
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: Packaging | |
run-name: Packaging triggered by ${{ github.actor }} | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build-frontend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./frontend | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nodejs | |
uses: actions/setup-node@v4 | |
with: | |
# TODO: use newer version once this works | |
node-version: "20" | |
- name: Install npm packages | |
run: npm install | |
- name: Build the frontend | |
env: | |
NODE_ENV: local | |
VITE_API_URL: / | |
run: npm run build | |
- name: Prepare assets for use by backend | |
run: | | |
cp -r dist/assets/ assets | |
cp dist/favicon.ico assets/favicon.ico | |
cp dist/.vite/manifest.json assets/manifest.json | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: frontend-artifact | |
# default workdir is only for runs, here we are using "uses" so it does not apply | |
path: frontend/assets/ | |
overwrite: true | |
bundle-linux: | |
runs-on: ubuntu-latest | |
needs: build-frontend | |
defaults: | |
run: | |
working-directory: ./backend | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Frontend Build | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./backend/assets/ | |
name: frontend-artifact | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install dependencies | |
run: uv sync --no-dev --frozen | |
- name: Run pyinstaller | |
run: | | |
uv run --no-sync --with pyinstaller==5.13.2 pyinstaller --clean --distpath linux_dist -y linux.spec | |
tar -cvf ../dataline.tar linux_dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dataline-linux.tar | |
# default workdir is only for runs, here we are using "uses" so it does not apply | |
path: dataline.tar | |
overwrite: true | |
bundle-windows: | |
runs-on: windows-latest | |
needs: build-frontend | |
defaults: | |
run: | |
working-directory: ./backend | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Frontend Build | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./backend/assets/ | |
name: frontend-artifact | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install dependencies | |
run: uv sync --no-dev --frozen | |
- name: Run pyinstaller | |
run: | | |
uv run --no-sync --with pyinstaller==6.11.0 pyinstaller --clean --distpath win64_dist -y windows.spec | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dataline-windows | |
# default workdir is only for runs, here we are using "uses" so it does not apply | |
path: build/windows | |
overwrite: true | |
bundle-macos: | |
strategy: | |
matrix: | |
os: [macos-latest] | |
runs-on: ${{ matrix.os }} | |
needs: build-frontend | |
defaults: | |
run: | |
working-directory: ./backend | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Frontend Build | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./backend/assets/ | |
name: frontend-artifact | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
# pyodbc issue with Mac builds | |
# https://stackoverflow.com/questions/75442083/import-pyodbc-error-while-running-a-python-script-on-pycharm-on-mac | |
- name: Install unixODBC | |
run: | | |
brew install unixodbc | |
odbcinst -j | |
- name: Set ODBC environment variables | |
run: | | |
echo "LDFLAGS=-L/usr/local/opt/unixodbc/lib" >> $GITHUB_ENV | |
echo "CPPFLAGS=-I/usr/local/opt/unixodbc/include" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: uv sync --no-dev --frozen --compile-bytecode | |
- name: Run pyinstaller | |
run: | | |
uv run --no-sync --with pyinstaller==5.13.2 pyinstaller --clean --distpath macos_dist -y macos.spec | |
cd macos_dist | |
tar -cf ../../dataline.tar dataline | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dataline-${{ matrix.os }}.tar | |
# default workdir is only for runs, here we are using "uses" so it does not apply | |
path: dataline.tar | |
overwrite: true |