From dc3e20417ef4c8a276955f89c617af3c5f163e1d Mon Sep 17 00:00:00 2001 From: ValentinRapp Date: Sun, 7 Jun 2026 21:20:09 +0200 Subject: [PATCH] updated CI --- .github/workflows/release.yml | 65 ++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 340f1c1..59286e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,26 +11,8 @@ permissions: contents: write jobs: - create-release: - name: Ensure Release Exists - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Create or Update GitHub Release Header - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'canary' }} - name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'Canary Build' }} - draft: false - prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - build-and-upload: - name: Build & Upload on ${{ matrix.os }} - needs: create-release + build: + name: Build on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -56,23 +38,52 @@ jobs: fi shell: bash - - name: Upload Release Artifacts + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: artifacts-${{ matrix.os }} + path: artifacts/ + retention-days: 1 + + release: + name: Create GitHub Release + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Download All Build Artifacts + uses: actions/download-artifact@v4 + with: + path: all-artifacts + + - name: Flatten Artifacts Directory + run: | + mkdir -p dist-artifacts + find all-artifacts -type f -exec cp -v {} dist-artifacts/ \; + echo "Files to upload:" + ls -l dist-artifacts + + - name: Create or Update GitHub Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'canary' }} - files: artifacts/* - fail_on_unmatched_files: false + name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'Canary Build' }} + draft: false + prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') }} + files: dist-artifacts/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Calculate sha256 - if: matrix.os == 'macos-latest' && startsWith(github.ref, 'refs/tags/v') + - name: Calculate sha256 of macOS DMG + if: startsWith(github.ref, 'refs/tags/v') id: sha run: | - echo "hash=$(shasum -a 256 artifacts/stable-macos-arm64-yafw.dmg | awk '{print $1}')" >> $GITHUB_OUTPUT + echo "hash=$(sha256sum dist-artifacts/stable-macos-arm64-yafw.dmg | awk '{print $1}')" >> $GITHUB_OUTPUT - name: Update Homebrew Tap (Cask) - if: matrix.os == 'macos-latest' && startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') uses: actions/github-script@v7 with: github-token: ${{ secrets.HOMEBREW_TAP_TOKEN }}