Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 0 additions & 199 deletions .github/workflows/electron-build.yml

This file was deleted.

145 changes: 145 additions & 0 deletions .github/workflows/photino-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Photino Build

on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
version:
description: 'Version to build (optional)'
required: false
type: string

jobs:
build-photino:
runs-on: ${{ matrix.os }}
permissions:
contents: write

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
platform: linux
rid: linux-x64
- os: windows-latest
platform: win32
rid: win-x64
- os: macos-latest
platform: darwin
rid: osx-x64

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: src/CommandRunner.Website.VueJs/package-lock.json

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Install Vue dependencies
working-directory: src/CommandRunner.Website.VueJs
run: npm ci

- name: Build Vue app
working-directory: src/CommandRunner.Website.VueJs
run: npm run build

- name: Publish Photino desktop host (${{ matrix.rid }})
run: |
dotnet publish src/CommandRunner.Desktop -c Release -r ${{ matrix.rid }} --self-contained true -o publish/${{ matrix.platform }}

- name: Verify wwwroot was bundled
shell: bash
run: |
if [ ! -f "publish/${{ matrix.platform }}/wwwroot/index.html" ]; then
echo "wwwroot/index.html missing from publish output -- Vue build didn't get bundled"
exit 1
fi
echo "wwwroot bundled correctly:"
ls publish/${{ matrix.platform }}/wwwroot

- name: Package build (Linux)
if: matrix.platform == 'linux'
run: |
cd publish/linux
tar czf ../../CommandRunner-linux-x64.tar.gz .
cd ../..
echo "Note: running the app requires libwebkit2gtk-4.1-0 (or libwebkit2gtk-4.0-37 on older distros) installed on the target machine -- it is not bundled, same as any WebKitGTK-based desktop app."

- name: Package build (Windows)
if: matrix.platform == 'win32'
shell: pwsh
run: |
Compress-Archive -Path publish/win32/* -DestinationPath CommandRunner-win-x64.zip

- name: Package build (macOS)
if: matrix.platform == 'darwin'
run: |
cd publish/darwin
zip -r ../../CommandRunner-osx-x64.zip .
cd ../..

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: command-runner-desktop-${{ matrix.platform }}-${{ github.run_number }}
path: |
CommandRunner-*.tar.gz
CommandRunner-*.zip
retention-days: 30

- name: Create Pre-release (on PR)
if: github.event_name == 'pull_request'
uses: softprops/action-gh-release@v1
with:
tag_name: pr-${{ github.event.pull_request.number }}-photino-${{ matrix.platform }}-${{ github.run_number }}
name: PR #${{ github.event.pull_request.number }} Photino pre-release (${{ matrix.platform }})
target_commitish: ${{ github.sha }}
files: |
CommandRunner-*.tar.gz
CommandRunner-*.zip
generate_release_notes: false
draft: false
prerelease: true
overwrite_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release (on tag push)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
files: |
CommandRunner-*.tar.gz
CommandRunner-*.zip
generate_release_notes: true
draft: false
prerelease: false
overwrite_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

cleanup-workflow-run-logs:
needs: build-photino
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Cleanup workflow run logs
uses: igorjs/gh-actions-clean-workflow@v4
with:
days_old: "7"
runs_to_keep: "5"
17 changes: 0 additions & 17 deletions .github/workflows/reusable-build-and-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Setup Node.js for React app
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: src/CommandRunner.ReactWebsite/package-lock.json

- name: Install React dependencies
run: |
cd src/CommandRunner.ReactWebsite
npm ci

- name: Build React app
run: |
cd src/CommandRunner.ReactWebsite
npm run build

- name: Restore .NET dependencies
run: dotnet restore

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ node_modules/

# Build outputs
dist/
dist-electron/
publish/
*.AppImage
*.deb
*.rpm
Expand Down
Loading
Loading