chore: update build workflow to create GitHub releases and modify publish settings

This commit is contained in:
2026-04-17 18:55:35 +10:00
parent 8e8b5a732c
commit 42f21c274f
18 changed files with 68 additions and 671 deletions

View File

@@ -1,365 +0,0 @@
name: Build Paarrot Windows
on:
push:
branches: [ main, development ]
pull_request:
branches: [ main ]
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
start-vm:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check if VM is already running
id: check-vm
run: |
if pgrep -f "qemu-system-x86_64.*windows.qcow2" > /dev/null; then
echo "VM is already running"
echo "vm_running=true" >> $GITHUB_OUTPUT
else
echo "VM is not running"
echo "vm_running=false" >> $GITHUB_OUTPUT
fi
- name: Start Windows VM with retry
run: |
MAX_RETRIES=3
RETRY_COUNT=0
BOOT_WAIT=90
RUNNER_CHECK_TIMEOUT=120
start_vm() {
echo "Starting Windows QEMU VM (attempt $((RETRY_COUNT + 1))/$MAX_RETRIES)..."
sudo -u litruv setsid bash -c 'DISPLAY=:0 XAUTHORITY=/home/litruv/.Xauthority qemu-system-x86_64 \
-m 18G \
-smp 4 \
-enable-kvm \
-cpu host \
-drive file=/home/litruv/windows.qcow2,format=qcow2 \
-boot d \
-vga virtio \
-display vnc=:0 \
> /tmp/qemu.log 2>&1' &
disown
}
kill_vm() {
echo "Killing VM..."
sudo pkill -9 qemu-system-x86 || true
sleep 5
}
check_runner() {
API_URL="${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/runners"
RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.CI_BOT_TOKEN }}" "$API_URL" 2>/dev/null)
if [ -z "$RESPONSE" ]; then
echo " Could not query runner API"
return 1
fi
ONLINE=$(echo "$RESPONSE" | jq -r '.runners[] | select(.labels[].name == "windows-vm") | select(.status == "online") | .name' 2>/dev/null)
if [ -n "$ONLINE" ]; then
echo " Runner found online!"
return 0
fi
echo " Windows runner (windows-vm) is NOT online"
return 1
}
wait_for_runner() {
local max_checks=$1
local required_successes=${2:-1}
local successes=0
echo "Waiting for runner to come online (need ${required_successes} successful checks, max ${max_checks} attempts)..."
for i in $(seq 1 $max_checks); do
if check_runner; then
successes=$((successes + 1))
echo "Runner online check $successes/$required_successes passed ($i/$max_checks)"
if [ $successes -ge $required_successes ]; then
echo "Runner confirmed online after $successes consecutive checks!"
return 0
fi
else
successes=0
echo "Waiting for runner... ($i/$max_checks)"
fi
sleep 5
done
return 1
}
echo "Checking if runner is online..."
if wait_for_runner 12 12; then
echo "Runner verified online!"
exit 0
fi
if [ "${{ steps.check-vm.outputs.vm_running }}" == "true" ]; then
echo "VM process exists but runner not responding, restarting VM..."
kill_vm
fi
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
start_vm
echo "Waiting ${BOOT_WAIT}s for VM to boot..."
sleep $BOOT_WAIT
if ! pgrep -f "qemu-system-x86_64.*windows.qcow2" > /dev/null; then
echo "VM process not found, retrying..."
RETRY_COUNT=$((RETRY_COUNT + 1))
continue
fi
if wait_for_runner $((RUNNER_CHECK_TIMEOUT / 5)); then
exit 0
fi
echo "Runner did not come online, killing VM and retrying..."
kill_vm
RETRY_COUNT=$((RETRY_COUNT + 1))
done
echo "ERROR: Failed to start VM after $MAX_RETRIES attempts"
exit 1
- name: VM Status
run: |
if [ "${{ steps.check-vm.outputs.vm_running }}" == "true" ]; then
echo "Using existing VM"
else
echo "Started new VM"
fi
if pgrep -f "qemu-system-x86_64.*windows.qcow2" > /dev/null; then
echo "VM process confirmed running"
else
echo "ERROR: VM process not found!"
exit 1
fi
build:
runs-on: windows-vm
needs: start-vm
timeout-minutes: 60
steps:
- name: Cancel pending shutdown
shell: powershell
run: |
shutdown /s /t 1000 2>$null
shutdown /a 2>$null
Write-Host "Cancelled any pending shutdown"
- name: Disable sleep and power saving
shell: powershell
run: |
powercfg /change standby-timeout-ac 0
powercfg /change standby-timeout-dc 0
powercfg /change hibernate-timeout-ac 0
powercfg /change hibernate-timeout-dc 0
powercfg /change monitor-timeout-ac 0
powercfg /change monitor-timeout-dc 0
powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
Write-Host "Power saving disabled for build"
- name: Fast checkout (persistent repo)
shell: powershell
run: |
$ErrorActionPreference = "Continue"
$repoDir = "C:\BuildCache\cinny-desktop\Repo"
$serverUrl = "${{ github.server_url }}"
$repo = "${{ github.repository }}"
$branch = "${{ github.ref_name }}"
$token = "${{ secrets.CI_BOT_TOKEN }}"
$uri = [System.Uri]$serverUrl
$scheme = $uri.Scheme
$authority = $uri.Authority
$repoUrl = "${scheme}://${authority}/${repo}"
Write-Host "Using server: ${scheme}://${authority}"
if (-not (Test-Path "C:\BuildCache\cinny-desktop")) {
New-Item -ItemType Directory -Path "C:\BuildCache\cinny-desktop" -Force
}
git config --global credential.helper ""
git config --global "http.${scheme}://${authority}/.extraheader" "Authorization: token $token"
function Remove-GitLocks {
$lockFiles = @(
"$repoDir\.git\shallow.lock",
"$repoDir\.git\index.lock",
"$repoDir\.git\HEAD.lock",
"$repoDir\.git\config.lock"
)
foreach ($lock in $lockFiles) {
if (Test-Path $lock) {
Write-Host "Removing stale lock: $lock"
Remove-Item -Force $lock
}
}
}
function Do-Clone {
Write-Host "Cloning repository fresh..."
if (Test-Path $repoDir) {
Remove-Item -Recurse -Force $repoDir
}
$cloneSuccess = $false
for ($i = 1; $i -le 3; $i++) {
Write-Host "Clone attempt $i/3..."
& git clone --depth=1 --branch $branch $repoUrl $repoDir 2>&1 | Out-Host
if ($LASTEXITCODE -eq 0) {
$cloneSuccess = $true
break
}
Write-Host "Clone attempt $i failed, retrying in 5 seconds..."
if (Test-Path $repoDir) {
Remove-Item -Recurse -Force $repoDir
}
Start-Sleep -Seconds 5
}
if (-not $cloneSuccess) {
throw "Clone failed after 3 attempts"
}
Push-Location $repoDir
& git submodule update --init --recursive --depth=1 2>&1 | Out-Host
Pop-Location
}
function Do-Update {
Write-Host "Updating existing repo..."
Push-Location $repoDir
Remove-GitLocks
git remote set-url origin $repoUrl 2>$null
Write-Host "Remote URL updated"
git reset --hard HEAD 2>$null
if ($LASTEXITCODE -ne 0) {
Write-Host "Reset failed, repo may be corrupted"
Pop-Location
return $false
}
git clean -fdx -e node_modules/ -e cinny/node_modules/ 2>$null
$fetchSuccess = $false
for ($i = 1; $i -le 3; $i++) {
Write-Host "Fetch attempt $i/3..."
& git fetch origin $branch --depth=1 2>&1 | Out-Host
if ($LASTEXITCODE -eq 0) {
$fetchSuccess = $true
break
}
Write-Host "Fetch attempt $i failed, retrying in 5 seconds..."
Start-Sleep -Seconds 5
}
if (-not $fetchSuccess) {
Write-Host "All fetch attempts failed"
Pop-Location
return $false
}
& git checkout -B $branch origin/$branch 2>&1 | Out-Host
if ($LASTEXITCODE -ne 0) {
Write-Host "Checkout failed"
Pop-Location
return $false
}
& git submodule update --init --recursive --depth=1 2>&1 | Out-Host
Pop-Location
return $true
}
if (Test-Path "$repoDir\.git") {
$success = Do-Update
if (-not $success) {
Write-Host "Update failed, will re-clone..."
Do-Clone
}
} else {
Do-Clone
}
if (-not (Test-Path "$repoDir\package.json")) {
throw "Checkout verification failed - package.json not found"
}
Write-Host "Checkout complete at: $repoDir"
- name: Install dependencies
shell: powershell
run: |
$ErrorActionPreference = "Stop"
$repoDir = "C:\BuildCache\cinny-desktop\Repo"
Push-Location $repoDir
Write-Host "Installing root dependencies..."
npm ci --prefer-offline --no-audit
Write-Host "Installing cinny dependencies..."
Push-Location cinny
npm ci --prefer-offline --no-audit
Pop-Location
Pop-Location
Write-Host "Dependencies installed"
- name: Build Paarrot
shell: powershell
run: |
$ErrorActionPreference = "Stop"
$repoDir = "C:\BuildCache\cinny-desktop\Repo"
Push-Location $repoDir
Write-Host "Building Paarrot..."
npm run build:win
Pop-Location
Write-Host "Build completed successfully!"
- name: Upload artifacts
shell: powershell
run: |
$ErrorActionPreference = "Stop"
$repoDir = "C:\BuildCache\cinny-desktop\Repo"
$artifactDir = "$repoDir\dist-electron"
if (-not (Test-Path $artifactDir)) {
Write-Error "Build artifacts not found at $artifactDir"
exit 1
}
Write-Host "Build artifacts:"
Get-ChildItem $artifactDir -Recurse | Select-Object FullName
# TODO: Copy artifacts to artifact server or release location
Write-Host "Artifacts ready at: $artifactDir"
- name: Schedule delayed shutdown
if: always()
shell: powershell
run: |
shutdown /s /t 900 /c "Build complete - shutting down in 15 minutes"
Write-Host "VM will shutdown in 15 minutes unless another build starts"

View File

@@ -283,3 +283,45 @@ jobs:
done
echo "Release complete!"
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.ghtoken }}
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
TAG_NAME="v${VERSION}"
GITHUB_REPO="Paarrot/Paarrot-Desktop"
# Check if release exists on GitHub
RELEASE_ID=$(curl -s -H "Authorization: token ${GH_TOKEN}" \
"https://api.github.com/repos/${GITHUB_REPO}/releases/tags/${TAG_NAME}" | jq -r '.id // empty')
if [ -z "$RELEASE_ID" ]; then
echo "Creating new GitHub release for ${TAG_NAME}..."
RELEASE_ID=$(curl -s -X POST \
-H "Authorization: token ${GH_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"${TAG_NAME}\", \"name\": \"Release ${TAG_NAME}\", \"body\": \"Release ${VERSION}\", \"draft\": false, \"prerelease\": false}" \
"https://api.github.com/repos/${GITHUB_REPO}/releases" | jq -r '.id')
echo "Created GitHub release with ID: ${RELEASE_ID}"
else
echo "GitHub release exists with ID: ${RELEASE_ID}"
fi
# Upload assets to GitHub
echo "Uploading assets to GitHub..."
UPLOAD_URL=$(curl -s -H "Authorization: token ${GH_TOKEN}" \
"https://api.github.com/repos/${GITHUB_REPO}/releases/${RELEASE_ID}" | jq -r '.upload_url' | sed 's/{?name,label}//')
for FILE in release-files/*; do
FILENAME=$(basename "$FILE")
echo "Uploading ${FILENAME} to GitHub..."
curl -s -X POST \
-H "Authorization: token ${GH_TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary "@${FILE}" \
"${UPLOAD_URL}?name=${FILENAME}"
echo ""
done
echo "GitHub release complete!"

3
.github/FUNDING.yml vendored
View File

@@ -1,3 +0,0 @@
github: ajbura
liberapay: ajbura
open_collective: cinny

View File

@@ -1,58 +0,0 @@
name: 🐞 Bug Report
description: Report a bug
labels: 'type: bug'
body:
- type: markdown
attributes:
value: |
## First of all
1. Please search for [existing issues](https://github.com/cinnyapp/cinny-desktop/issues?q=is%3Aissue) about this problem first.
2. Make sure Cinny is up to date.
3. Make sure it's an issue with Cinny and not something else you are using.
4. Remember to be friendly.
- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear description of what the bug is. Include screenshots if applicable.
placeholder: Bug description
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Steps to reproduce the behavior.
placeholder: |
1. Go to ...
2. Click on ...
3. See error
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: A clear description of what you expected to happen.
- type: textarea
id: info
attributes:
label: Platform and versions
description: "Provide OS, browser and Cinny version with your Homeserver."
placeholder: |
1. OS: [e.g. Windows 10, MacOS]
2. Cinny version: [e.g. 1.8.1]
3. Matrix homeserver: [e.g. matrix.org]
4. Downloaded from: [e.g. GitHub, Flatpak]
render: shell
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context about the problem here.

View File

@@ -1,4 +0,0 @@
contact_links:
- name: 💬 Matrix Chat
url: https://matrix.to/#/#cinny:matrix.org
about: Ask questions and talk to other Cinny users and the maintainers

View File

@@ -1,34 +0,0 @@
name: 💡 Feature Request
description: Suggest an idea
labels: 'type: feature'
body:
- type: textarea
id: problem
attributes:
label: Describe the problem
description: A clear description of the problem this feature would solve
placeholder: "I'm always frustrated when..."
validations:
required: true
- type: textarea
id: solution
attributes:
label: "Describe the solution you'd like"
description: A clear description of what change you would like
placeholder: "I would like to..."
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: "Any alternative solutions you've considered"
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context about the problem here.

View File

@@ -1,22 +0,0 @@
<!-- Please read https://github.com/cinnyapp/cinny/blob/dev/CONTRIBUTING.md before submitting your pull request -->
### Description
<!-- Please include a summary of the change. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
Fixes #
#### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings

3
.github/SECURITY.md vendored
View File

@@ -1,3 +0,0 @@
# Reporting a Vulnerability
**If you've found a security vulnerability, please report it to cinnyapp@gmail.com**

View File

@@ -1,30 +0,0 @@
# Docs: <https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/customizing-dependency-updates>
version: 2
updates:
# - package-ecosystem: npm
# directory: /
# schedule:
# interval: weekly
# day: "tuesday"
# time: "01:00"
# timezone: "Asia/Kolkata"
# open-pull-requests-limit: 15
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: "tuesday"
time: "01:00"
timezone: "Asia/Kolkata"
open-pull-requests-limit: 5
# - package-ecosystem: cargo
# directory: /src-tauri/
# schedule:
# interval: weekly
# day: "tuesday"
# time: "01:00"
# timezone: "Asia/Kolkata"
# open-pull-requests-limit: 5

21
.github/renovate.json vendored
View File

@@ -1,21 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":dependencyDashboardApproval"
],
"labels": [
"Dependencies"
],
"packageRules": [
{
"matchUpdateTypes": [
"lockFileMaintenance"
]
}
],
"lockFileMaintenance": {
"enabled": true
},
"dependencyDashboard": true
}

View File

@@ -1,22 +0,0 @@
name: "Upload zip-archive"
on:
release:
types: [published]
jobs:
zip-archive:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.0
with:
submodules: true
- name: Create zip including submodules
run: |
cd ..
zip ${{ github.event.repository.name }}/${{ github.event.repository.name }}-${{ github.ref_name }}.zip ${{ github.event.repository.name }} -r
- name: Upload zip to release
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836
with:
files: |
${{ github.event.repository.name }}-${{ github.ref_name }}.zip

View File

@@ -1,36 +0,0 @@
name: 'CLA Assistant'
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]
jobs:
CLAssistant:
runs-on: ubuntu-latest
steps:
- name: 'CLA Assistant'
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
# Beta Release
uses: cla-assistant/github-action@v2.6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_PAT }}
with:
path-to-signatures: 'signatures.json'
path-to-document: 'https://github.com/cinnyapp/cla/blob/main/cla.md' # e.g. a CLA or a DCO document
# branch should not be protected
branch: 'main'
allowlist: ajbura,bot*
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
remote-organization-name: cinnyapp
remote-repository-name: cla
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
#use-dco-flag: true - If you are using DCO instead of CLA

View File

@@ -1,26 +0,0 @@
name: NPM Lockfile Changes
on:
pull_request:
paths:
- 'package-lock.json'
jobs:
lockfile_changes:
runs-on: ubuntu-latest
# Permission overwrite is required for Dependabot PRs, see "Common issues" below.
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4.2.0
- name: NPM Lockfile Changes
uses: codepunkt/npm-lockfile-changes@b40543471c36394409466fdb277a73a0856d7891
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Optional inputs, can be deleted safely if you are happy with default values.
collapsibleThreshold: 25
failOnDowngrade: false
path: package-lock.json
updateComment: true

View File

@@ -1,40 +0,0 @@
name: "Build pull request"
on:
#pull_request:
#types: ['opened', 'synchronize']
jobs:
publish-tauri:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.0
with:
submodules: true
- name: Setup node
uses: actions/setup-node@v4.4.0
with:
node-version: 20.12.2
cache: 'npm'
- name: Install Rust stable
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Install cinny dependencies
run: cd cinny && npm ci
- name: Install tauri dependencies
run: npm ci
- name: Build desktop app with Tauri
uses: tauri-apps/tauri-action@v0.5.14
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

10
build-and-publish.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Set GitHub token for publishing
export GH_TOKEN="ghtoken"
# Run the build and publish
npm run build
# Exit with the build's exit code
exit $?

2
cinny

Submodule cinny updated: b3deb4d518...9eb5e4fa32

View File

@@ -90,9 +90,18 @@
"iconUrl": "http://synbox.ruv.wtf:8418/litruv/cinny-desktop/raw/branch/main/icons/icon.ico",
"remoteReleases": false
},
"publish": {
"provider": "generic",
"url": "http://synbox.ruv.wtf:8418/litruv/cinny-desktop/releases/download/v${version}",
"channel": "latest"
}
"publish": [
{
"provider": "generic",
"url": "http://synbox.ruv.wtf:8418/litruv/cinny-desktop/releases/download/v${version}",
"channel": "latest"
},
{
"provider": "github",
"owner": "Paarrot",
"repo": "Paarrot-Desktop",
"token": "${env.GH_TOKEN}",
"releaseType": "release"
}
]
}

View File

@@ -11,7 +11,7 @@
"dev": "concurrently \"npm run dev:vite\" \"npm run dev:electron\"",
"dev:vite": "cd cinny && npm start",
"dev:electron": "wait-on http://localhost:38347 && cross-env NODE_ENV=development electron .",
"build": "node -e \"require('fs').copyFileSync('config.json', 'cinny/config.json')\" && cd cinny && npm run build && cd .. && electron-builder --publish never",
"build": "node -e \"require('fs').copyFileSync('config.json', 'cinny/config.json')\" && cd cinny && npm run build && cd .. && electron-builder --publish always",
"build:linux": "npm run build -- --linux",
"build:win": "npm run build -- --win",
"postman:generate": "node scripts/generate-postman-collection.js"