💎 Built using [Crystal](https://github.com/stravu/crystal) Co-Authored-By: Crystal <crystal@stravu.com>
119 lines
4.0 KiB
YAML
119 lines
4.0 KiB
YAML
name: Release Crystal
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*' # Triggers on version tags like v0.1.0, v1.0.0, etc.
|
|
|
|
jobs:
|
|
release:
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest]
|
|
include:
|
|
- os: macos-latest
|
|
release_cmd: release:mac:universal
|
|
artifact_name: crystal-macos
|
|
artifact_path: |
|
|
dist-electron/*.dmg
|
|
dist-electron/*.zip
|
|
dist-electron/latest-mac.yml
|
|
- os: ubuntu-latest
|
|
release_cmd: release:linux
|
|
artifact_name: crystal-linux
|
|
artifact_path: |
|
|
dist-electron/*.deb
|
|
dist-electron/*.AppImage
|
|
dist-electron/latest-linux.yml
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
permissions:
|
|
contents: write # Required for creating releases
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22.15.1'
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Build main process
|
|
run: pnpm run build:main
|
|
|
|
- name: Build and publish application
|
|
run: pnpm run ${{ matrix.release_cmd }}
|
|
env:
|
|
# GitHub token for publishing release
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# macOS code signing certificate
|
|
CSC_LINK: ${{ matrix.os == 'macos-latest' && secrets.APPLE_CERTIFICATE || '' }}
|
|
CSC_KEY_PASSWORD: ${{ matrix.os == 'macos-latest' && secrets.APPLE_CERTIFICATE_PASSWORD || '' }}
|
|
# macOS notarization credentials
|
|
APPLE_ID: ${{ matrix.os == 'macos-latest' && secrets.APPLE_ID || '' }}
|
|
APPLE_APP_SPECIFIC_PASSWORD: ${{ matrix.os == 'macos-latest' && secrets.APPLE_APP_PASSWORD || '' }}
|
|
APPLE_TEAM_ID: ${{ matrix.os == 'macos-latest' && secrets.APPLE_TEAM_ID || '' }}
|
|
# Enable automatic certificate discovery
|
|
CSC_IDENTITY_AUTO_DISCOVERY: ${{ matrix.os == 'macos-latest' && 'true' || 'false' }}
|
|
|
|
- name: List release artifacts
|
|
run: ls -la dist-electron/
|
|
|
|
# - name: Build Flatpak
|
|
# if: matrix.os == 'ubuntu-latest'
|
|
# run: |
|
|
# # Install flatpak-builder
|
|
# sudo apt-get update
|
|
# sudo apt-get install -y flatpak flatpak-builder
|
|
#
|
|
# # Add flathub repository
|
|
# sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
#
|
|
# # Install required runtime and SDK
|
|
# sudo flatpak install -y flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 org.electronjs.Electron2.BaseApp//23.08
|
|
#
|
|
# # Find the actual AppImage file
|
|
# echo "Looking for AppImage files..."
|
|
# ls -la dist-electron/*.AppImage || true
|
|
#
|
|
# # Get the AppImage path (handle different naming patterns)
|
|
# APPIMAGE=$(ls dist-electron/*.AppImage 2>/dev/null | head -n1)
|
|
# if [ -z "$APPIMAGE" ]; then
|
|
# echo "Error: No AppImage found in dist-electron/"
|
|
# exit 1
|
|
# fi
|
|
# echo "Found AppImage: $APPIMAGE"
|
|
#
|
|
# # Update manifest with actual AppImage path
|
|
# sed -i "s|path: dist-electron/Crystal-\*.AppImage|path: $APPIMAGE|" com.stravu.crystal.yml
|
|
#
|
|
# # Build Flatpak
|
|
# flatpak-builder --force-clean --repo=repo build-dir com.stravu.crystal.yml
|
|
#
|
|
# # Create bundle
|
|
# flatpak build-bundle repo dist-electron/crystal.flatpak com.stravu.crystal
|
|
#
|
|
# # List artifacts again to confirm
|
|
# ls -la dist-electron/
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact_name }}-${{ github.ref_name }}
|
|
path: ${{ matrix.artifact_path }}
|
|
if-no-files-found: error
|
|
retention-days: 90 |