diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8c27142..155d915 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,6 +72,14 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} pack: + strategy: + matrix: + rid: + - win-arm64 + - win-x86 + - win-x64 + + # Needs to run on Windows to create the installer runs-on: windows-latest timeout-minutes: 10 @@ -95,7 +103,8 @@ jobs: -p:CSharpier_Bypass=true --output LightBulb/bin/publish/ --configuration Release - --use-current-runtime + --runtime ${{ matrix.rid }} + --self-contained - name: Create installer shell: pwsh @@ -109,18 +118,18 @@ jobs: - name: Upload artifacts (portable) uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: - name: LightBulb + name: LightBulb.${{ matrix.rid }} path: LightBulb/bin/publish/ if-no-files-found: error - name: Upload artifacts (installer) uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: - name: LightBulb-Installer + name: LightBulb-Installer.${{ matrix.rid }} path: Installer/bin/LightBulb-Installer.exe if-no-files-found: error - deploy: + release: if: ${{ github.ref_type == 'tag' }} needs: @@ -131,6 +140,33 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 + permissions: + contents: write + + steps: + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: > + gh release create ${{ github.ref_name }} + --repo ${{ github.event.repository.full_name }} + --title ${{ github.ref_name }} + --generate-notes + --verify-tag + + deploy: + needs: release + + strategy: + matrix: + rid: + - win-arm64 + - win-x86 + - win-x64 + + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: actions: read contents: write @@ -139,30 +175,27 @@ jobs: - name: Download artifacts (portable) uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 with: - name: LightBulb + name: LightBulb.${{ matrix.rid }} path: LightBulb/ - name: Download artifacts (installer) uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 with: - name: LightBulb-Installer + name: LightBulb-Installer.${{ matrix.rid }} - name: Create package (portable) # Change into the artifacts directory to avoid including the directory itself in the zip archive working-directory: LightBulb/ - run: zip -r ../LightBulb.zip . + run: zip -r ../LightBulb.${{ matrix.rid }}.zip . - name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: > - gh release create ${{ github.ref_name }} - LightBulb.zip - LightBulb-Installer.exe + gh release upload ${{ github.ref_name }} + LightBulb.${{ matrix.rid }}.zip + LightBulb-Installer.${{ matrix.rid }}.exe --repo ${{ github.event.repository.full_name }} - --title ${{ github.ref_name }} - --generate-notes - --verify-tag notify: needs: deploy diff --git a/LightBulb/LightBulb.csproj b/LightBulb/LightBulb.csproj index 00c8e75..63a9079 100644 --- a/LightBulb/LightBulb.csproj +++ b/LightBulb/LightBulb.csproj @@ -25,7 +25,6 @@ - diff --git a/LightBulb/Services/UpdateService.cs b/LightBulb/Services/UpdateService.cs index 45166af..fc597fb 100644 --- a/LightBulb/Services/UpdateService.cs +++ b/LightBulb/Services/UpdateService.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Runtime.InteropServices; using System.Threading.Tasks; using Onova; using Onova.Exceptions; @@ -10,7 +11,15 @@ namespace LightBulb.Services; public class UpdateService(SettingsService settingsService) : IDisposable { private readonly IUpdateManager _updateManager = new UpdateManager( - new GithubPackageResolver("Tyrrrz", "LightBulb", "LightBulb.zip"), + new GithubPackageResolver( + "Tyrrrz", + "LightBulb", + // Examples: + // LightBulb.win-arm64.zip + // LightBulb.win-x64.zip + // LightBulb.linux-x64.zip + $"LightBulb.{RuntimeInformation.RuntimeIdentifier}.zip" + ), new ZipPackageExtractor() ); diff --git a/ReadMe.md b/ReadMe.md index df22603..7a3ae14 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -43,9 +43,8 @@ To learn more about the war and how you can help, [click here](https://tyrrrz.me - 🟠 [CI build](https://github.com/Tyrrrz/LightBulb/actions/workflows/main.yml) - 📦 [WinGet](https://github.com/microsoft/winget-cli): `winget install Tyrrrz.LightBulb` (community-maintained) -> **Warning**: -> **LightBulb** only works on Windows 7 and higher. -> Other operating systems are not supported. +> **Note**: +> If you're unsure which build is right for your system, consult with [this page](https://useragent.cc) to determine your OS and CPU architecture. ## Features