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