From 4f1595f4c17340c014f7205dfd743ea70d39c874 Mon Sep 17 00:00:00 2001 From: Asher Norland Date: Sun, 15 Feb 2026 17:13:17 -0800 Subject: [PATCH 1/2] Workflow Simplifications --- .github/workflows/build.yml | 5 -- .github/workflows/dev-release-build.yml | 92 --------------------- .github/workflows/package.yml | 52 ++++++------ .github/workflows/release-build.yml | 102 ++++++++++++++++++++---- 4 files changed, 110 insertions(+), 141 deletions(-) delete mode 100644 .github/workflows/dev-release-build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d7447c..2087b01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/.github/workflows/dev-release-build.yml b/.github/workflows/dev-release-build.yml deleted file mode 100644 index fd2c02b..0000000 --- a/.github/workflows/dev-release-build.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Development Release Build - -# Builds and publishes development releases to GitHub Releases using Velopack. -# Triggered after successful Python dev release workflow. - -on: - workflow_run: - workflows: ["Update Python Development Release"] - types: [completed] - branches: - - development - - main - -permissions: - contents: write - -jobs: - get-version: - if: github.event.workflow_run.conclusion == 'success' && github.repository == 'synodic/synodic-client' - runs-on: ubuntu-latest - outputs: - version: ${{ steps.set-version.outputs.version }} - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - filter: blob:none - - - name: Semantic Version - id: version - uses: PaulHatch/semantic-version@v6.0.1 - with: - tag_prefix: "v" - version_format: "${major}.${minor}.${patch}" - - - name: Set Version - id: set-version - run: | - version=${{ steps.version.outputs.version }}.dev${{ steps.version.outputs.increment }} - echo "version=${version}" >> $GITHUB_OUTPUT - echo "Development version: $version" - - 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: dev - - release: - needs: [get-version, package] - runs-on: ubuntu-latest - steps: - - name: Download release artifacts - uses: actions/download-artifact@v4 - with: - name: velopack-releases - path: releases - - - name: Delete existing dev release - run: gh release delete dev --cleanup-tag -y || true - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - - - name: Create dev release - 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 diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 87f295f..ba94b50 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -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: @@ -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/ diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index ecad5d5..ed4f660 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -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: @@ -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] @@ -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 }} From 8fcf1e5f16eab57fcaecfc29b1ae3aa032a8390b Mon Sep 17 00:00:00 2001 From: Asher Norland Date: Sun, 15 Feb 2026 17:39:43 -0800 Subject: [PATCH 2/2] Build Workflow --- .github/workflows/build.yml | 6 +-- .github/workflows/package.yml | 83 +++++++++++++++-------------- .github/workflows/release-build.yml | 26 ++++----- 3 files changed, 55 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2087b01..c8067a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: build-windows-x64 - path: dist/* + path: dist/synodic build-linux: if: github.repository_owner == 'synodic' @@ -60,7 +60,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: build-linux-x64 - path: dist/* + path: dist/synodic build-macos: if: github.repository_owner == 'synodic' @@ -85,4 +85,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: build-macos-x64 - path: dist/* + path: dist/synodic diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index ba94b50..67d463a 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -17,26 +17,31 @@ on: outputs: artifact-name: description: "Name of the uploaded release artifact" - value: ${{ jobs.package.outputs.artifact-name }} + value: ${{ jobs.collect-releases.outputs.artifact-name }} 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: runs-on: ubuntu-latest - outputs: - artifact-name: velopack-releases + strategy: + fail-fast: true + matrix: + include: + - artifact: build-windows-x64 + main_exe: synodic.exe + - artifact: build-linux-x64 + main_exe: synodic + - artifact: build-macos-x64 + main_exe: synodic steps: - - name: Download all build artifacts + - name: Download build artifact uses: actions/download-artifact@v4 with: - path: builds + name: ${{ matrix.artifact }} + path: pack - name: Install Velopack CLI run: dotnet tool install -g vpk @@ -50,46 +55,42 @@ jobs: --token ${{ secrets.GITHUB_TOKEN }} - name: Install libfuse2 for AppImage + if: contains(matrix.artifact, 'linux') run: | sudo apt-get update sudo apt-get install -y libfuse2 - - name: Create Velopack packages - shell: bash + - name: Create Velopack package run: | - set -euo pipefail - - mkdir -p releases - package_count=0 - - while IFS=':' read -r artifact_dir main_exe; do - [ -n "${artifact_dir}" ] || continue - - pack_dir="builds/${artifact_dir}" - - if [ ! -d "${pack_dir}" ]; then - continue - fi - - vpk pack \ - --packId ${{ env.VELOPACK_APP_ID }} \ - --packVersion ${{ inputs.version }} \ - --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 }}" + vpk pack \ + --packId ${{ env.VELOPACK_APP_ID }} \ + --packVersion ${{ inputs.version }} \ + --packDir pack \ + --mainExe ${{ matrix.main_exe }} \ + --packTitle "${{ env.VELOPACK_APP_TITLE }}" \ + --channel ${{ inputs.channel }} \ + --outputDir releases - if [ "${package_count}" -eq 0 ]; then - echo "No build artifacts found to package." >&2 - exit 1 - fi + - name: Upload release artifacts + uses: actions/upload-artifact@v4 + with: + name: velopack-release-${{ matrix.artifact }} + path: releases/* - ls -la releases/ + collect-releases: + needs: package + runs-on: ubuntu-latest + outputs: + artifact-name: velopack-releases + steps: + - name: Download all release artifacts + uses: actions/download-artifact@v4 + with: + pattern: velopack-release-* + path: releases + merge-multiple: true - - name: Upload release artifacts + - name: Upload combined release artifacts uses: actions/upload-artifact@v4 with: name: velopack-releases diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index ed4f660..a5c04d4 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -54,31 +54,25 @@ jobs: 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" + echo "version=${base_version}.dev${increment}" >> $GITHUB_OUTPUT + echo "installer-version=${base_version}-dev.${increment}" >> $GITHUB_OUTPUT + echo "channel=dev" >> $GITHUB_OUTPUT + echo "tag=dev" >> $GITHUB_OUTPUT + echo "is-dev=true" >> $GITHUB_OUTPUT else 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" + echo "version=${version}" >> $GITHUB_OUTPUT + echo "installer-version=${version}" >> $GITHUB_OUTPUT + echo "channel=stable" >> $GITHUB_OUTPUT + echo "tag=v${version}" >> $GITHUB_OUTPUT + echo "is-dev=false" >> $GITHUB_OUTPUT fi - 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