From 2a23481d23c9ce6eff5a570064fe5ae5aff7df96 Mon Sep 17 00:00:00 2001 From: Daniel Chalmers Date: Wed, 3 Jun 2026 17:26:32 -0500 Subject: [PATCH] Simplify release workflow --- .../create-release-artifacts/action.yml | 12 +----- .github/workflows/build.yml | 8 ++++ .github/workflows/deploy.yml | 40 +++++-------------- 3 files changed, 21 insertions(+), 39 deletions(-) diff --git a/.github/actions/create-release-artifacts/action.yml b/.github/actions/create-release-artifacts/action.yml index bf365c0..9c1ed0a 100644 --- a/.github/actions/create-release-artifacts/action.yml +++ b/.github/actions/create-release-artifacts/action.yml @@ -1,6 +1,6 @@ name: Create release artifacts -description: Creates release-ready binaries and uploads them as artifacts. +description: Creates release-ready binaries. inputs: version: @@ -18,18 +18,10 @@ runs: - name: Create binaries shell: bash run: | - dotnet tool install --global wix --version 4.0.6 + dotnet tool update --global wix --version 4.0.6 dotnet publish ./DesktopClock/DesktopClock.csproj -o "publish/${{ inputs.arch }}" -c Release --os win --arch "${{ inputs.arch }}" -p:Version="${{ inputs.version }}" wix build Product.wxs -d "MainExeSource=publish/${{ inputs.arch }}/DesktopClock.exe" -o "publish/DesktopClock-${{ inputs.version }}-${{ inputs.arch }}.msi" - name: Create portable ZIP shell: pwsh run: Compress-Archive -Path "publish/${{ inputs.arch }}/DesktopClock.exe" -DestinationPath "publish/DesktopClock-${{ inputs.version }}-${{ inputs.arch }}.zip" -Force - - - uses: actions/upload-artifact@v7 - with: - name: desktopclock-${{ inputs.arch }} - if-no-files-found: error - path: | - publish/*.zip - publish/*.msi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e26976e..0592224 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,3 +54,11 @@ jobs: - uses: ./.github/actions/create-release-artifacts with: arch: ${{ matrix.arch }} + + - uses: actions/upload-artifact@v7 + with: + name: desktopclock-${{ matrix.arch }} + if-no-files-found: error + path: | + publish/*.zip + publish/*.msi diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 919f486..f87487f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,53 +19,35 @@ on: default: true permissions: - contents: read + contents: write jobs: - build-test: - name: Build and test + release: + name: Release runs-on: windows-2025 steps: - uses: actions/checkout@v6 - uses: ./.github/actions/build-and-test - package: - name: Package ${{ matrix.arch }} - runs-on: windows-2025 - strategy: - fail-fast: false - matrix: - arch: [x64, arm64] - steps: - - uses: actions/checkout@v6 - - - uses: ./.github/actions/create-release-artifacts + - name: Package x64 + uses: ./.github/actions/create-release-artifacts with: version: ${{ inputs.version }} - arch: ${{ matrix.arch }} + arch: x64 - deploy: - name: Create GitHub release - needs: - - build-test - - package - runs-on: ubuntu-24.04 - permissions: - contents: write - steps: - - uses: actions/download-artifact@v8 + - name: Package arm64 + uses: ./.github/actions/create-release-artifacts with: - pattern: desktopclock-* - path: release-artifacts - merge-multiple: true + version: ${{ inputs.version }} + arch: arm64 - name: Create GitHub release if: ${{ !inputs.dryRun }} uses: ncipollo/release-action@v1.21.0 with: tag: "v${{ inputs.version }}" - artifacts: "release-artifacts/*.zip,release-artifacts/*.msi" + artifacts: "publish/*.zip,publish/*.msi" generateReleaseNotes: true prerelease: ${{ contains(inputs.version, '-') }} allowUpdates: ${{ inputs.updateRelease }}