From 788eb9c1b1823b9751a1a82acd425aa17bc01fc0 Mon Sep 17 00:00:00 2001 From: Tim Nunamaker Date: Thu, 7 Mar 2024 20:00:50 -0600 Subject: [PATCH] Build macOS --- .github/workflows/package.yml | 74 +++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/package.yml diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..b0f13d7 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,74 @@ +name: Build with PyInstaller + +on: + push: + branches: [main, fixes] + pull_request: + branches: [main, fixes] + +jobs: + build: + name: Build on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: +# os: [ubuntu-latest, macos-latest, windows-latest] + os: [macos-latest-xlarge] + python-version: [3.11] + + steps: + - uses: actions/checkout@v4 + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: poetry + cache-dependency-path: poetry.lock + + - name: Install dependencies with Poetry +# run: poetry install --no-dev + run: poetry install + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + cache-dependency-path: selfie-ui/yarn.lock + + - name: Cache Next.js build artifacts + uses: actions/cache@v4 + with: + path: | + selfie-ui/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('selfie-ui/**/yarn.lock') }}-${{ hashFiles('selfie-ui/**/*.js', 'selfie-ui/**/*.jsx', 'selfie-ui/**/*.ts', 'selfie-ui/**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('selfie-ui/**/yarn.lock') }}- + + - name: Install dependencies with Yarn + run: sh scripts/build-ui.sh + + - name: Install PyInstaller + run: poetry run pip install pyinstaller + + - name: Build with PyInstaller + run: poetry run pyinstaller selfie.spec --noconfirm + shell: bash + + - name: Archive Build Output + run: | + cd dist + tar -czvf selfie-build.tar.gz * + shell: bash + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}-build + path: dist/selfie-build.tar.gz