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 }}