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
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ name: Build Executables

on:
workflow_call:
inputs:
version:
description: "Version string for the build"
required: true
type: string

jobs:
build-windows:
Expand Down
92 changes: 0 additions & 92 deletions .github/workflows/dev-release-build.yml

This file was deleted.

52 changes: 25 additions & 27 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ on:

env:
VELOPACK_APP_ID: synodic
VELOPACK_APP_TITLE: Synodic Client
VELOPACK_TARGETS: |
build-windows-x64:synodic.exe
build-linux-x64:synodic
build-macos-x64:synodic

jobs:
package:
Expand Down Expand Up @@ -50,43 +55,36 @@ jobs:
sudo apt-get install -y libfuse2

- name: Create Velopack packages
shell: bash
run: |
set -euo pipefail

mkdir -p releases
package_count=0

# Windows package
if [ -d "builds/build-windows-x64" ]; then
vpk pack \
--packId ${{ env.VELOPACK_APP_ID }} \
--packVersion ${{ inputs.version }} \
--packDir builds/build-windows-x64 \
--mainExe synodic.exe \
--packTitle "Synodic Client" \
--channel ${{ inputs.channel }} \
--outputDir releases
fi
while IFS=':' read -r artifact_dir main_exe; do
[ -n "${artifact_dir}" ] || continue

# Linux package
if [ -d "builds/build-linux-x64" ]; then
vpk pack \
--packId ${{ env.VELOPACK_APP_ID }} \
--packVersion ${{ inputs.version }} \
--packDir builds/build-linux-x64 \
--mainExe synodic \
--packTitle "Synodic Client" \
--channel ${{ inputs.channel }} \
--outputDir releases
fi
pack_dir="builds/${artifact_dir}"

if [ ! -d "${pack_dir}" ]; then
continue
fi

# macOS package
if [ -d "builds/build-macos-x64" ]; then
vpk pack \
--packId ${{ env.VELOPACK_APP_ID }} \
--packVersion ${{ inputs.version }} \
--packDir builds/build-macos-x64 \
--mainExe synodic \
--packTitle "Synodic Client" \
--packDir "${pack_dir}" \
--mainExe "${main_exe}" \
--packTitle "${{ env.VELOPACK_APP_TITLE }}" \
--channel ${{ inputs.channel }} \
--outputDir releases
package_count=$((package_count + 1))
done <<< "${{ env.VELOPACK_TARGETS }}"

if [ "${package_count}" -eq 0 ]; then
echo "No build artifacts found to package." >&2
exit 1
fi

ls -la releases/
Expand Down
102 changes: 85 additions & 17 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: Release Build

# Builds and publishes stable releases to GitHub Releases using Velopack.
# Triggered by published releases or manual dispatch.
# Builds and publishes dev/stable releases to GitHub Releases using Velopack.
# Triggered by Python dev release updates, published releases, or manual dispatch.

on:
workflow_run:
workflows: ["Update Python Development Release"]
types: [completed]
branches:
- development
- main
release:
types: [published]
workflow_dispatch:
Expand All @@ -18,36 +24,71 @@ permissions:

jobs:
get-version:
if: github.repository == 'synodic/synodic-client' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
installer-version: ${{ steps.version.outputs.installer-version }}
tag: ${{ steps.version.outputs.tag }}
channel: ${{ steps.version.outputs.channel }}
is-dev: ${{ steps.version.outputs.is-dev }}
steps:
- name: Checkout
if: github.event_name == 'workflow_run'
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: blob:none

- name: Semantic Version
if: github.event_name == 'workflow_run'
id: semver
uses: PaulHatch/semantic-version@v6.0.1
with:
tag_prefix: "v"
version_format: "${major}.${minor}.${patch}"

- name: Get version
id: version
run: |
if [ "${{ github.event_name }}" == "release" ]; then
VERSION="${{ github.event.release.tag_name }}"
if [ "${{ github.event_name }}" == "workflow_run" ]; then
base_version="${{ steps.semver.outputs.version }}"
increment="${{ steps.semver.outputs.increment }}"
version="${base_version}.dev${increment}"
installer_version="${base_version}-dev.${increment}"
channel="dev"
tag="dev"
is_dev="true"
else
VERSION="${{ inputs.version }}"
if [ "${{ github.event_name }}" == "release" ]; then
version_input="${{ github.event.release.tag_name }}"
else
version_input="${{ inputs.version }}"
fi

version="${version_input#v}"
installer_version="${version}"
channel="stable"
tag="v${version}"
is_dev="false"
fi
# Strip leading 'v' if present
VERSION="${VERSION#v}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "tag=v${VERSION}" >> $GITHUB_OUTPUT

echo "version=${version}" >> $GITHUB_OUTPUT
echo "installer-version=${installer_version}" >> $GITHUB_OUTPUT
echo "channel=${channel}" >> $GITHUB_OUTPUT
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "is-dev=${is_dev}" >> $GITHUB_OUTPUT

build:
needs: get-version
uses: ./.github/workflows/build.yml
with:
version: ${{ needs.get-version.outputs.version }}

package:
needs: [get-version, build]
uses: ./.github/workflows/package.yml
with:
version: ${{ needs.get-version.outputs.version }}
channel: stable
version: ${{ needs.get-version.outputs.installer-version }}
channel: ${{ needs.get-version.outputs.channel }}

release:
needs: [get-version, package]
Expand All @@ -59,16 +100,43 @@ jobs:
name: velopack-releases
path: releases

# For releases triggered by release event
- name: Delete existing dev release
if: needs.get-version.outputs.is-dev == 'true'
run: gh release delete dev --cleanup-tag -y || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}

- name: Create dev release
if: needs.get-version.outputs.is-dev == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: dev
name: "Development Build"
prerelease: true
make_latest: false
files: releases/*
body: |
**Latest Development Build**

Version: `${{ needs.get-version.outputs.version }}`
Commit: `${{ github.sha }}`

⚠️ This is a development build and may be unstable.

## Installation
- **Windows**: Download `synodic-Setup.exe` and run it
- **Linux**: Download the `.AppImage` file, make it executable with `chmod +x`, and run
- **macOS**: Download and extract the package

- name: Upload to existing release
if: github.event_name == 'release'
if: needs.get-version.outputs.is-dev != 'true' && github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: releases/*

# For manual workflow_dispatch
- name: Create release
if: github.event_name == 'workflow_dispatch'
if: needs.get-version.outputs.is-dev != 'true' && github.event_name == 'workflow_dispatch'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.get-version.outputs.tag }}
Expand Down