From 82a648848ffe3e6d0056b18d01d1149c40ea9f1d Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:12:35 +0300 Subject: [PATCH 1/5] Produce self-contained builds of the app --- .github/workflows/main.yml | 5 +++-- LightBulb/LightBulb.csproj | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8c27142..b7a6656 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,7 +72,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} pack: - runs-on: windows-latest + runs-on: ubuntu-latest timeout-minutes: 10 permissions: @@ -95,7 +95,8 @@ jobs: -p:CSharpier_Bypass=true --output LightBulb/bin/publish/ --configuration Release - --use-current-runtime + --runtime win-x64 + --self-contained - name: Create installer shell: pwsh diff --git a/LightBulb/LightBulb.csproj b/LightBulb/LightBulb.csproj index d3ab0cd..381ba27 100644 --- a/LightBulb/LightBulb.csproj +++ b/LightBulb/LightBulb.csproj @@ -26,7 +26,6 @@ - From 1d9787988cfe2ae257c222c7eb91857c075ae76e Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:15:06 +0300 Subject: [PATCH 2/5] asd --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7a6656..9671342 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,7 +72,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} pack: - runs-on: ubuntu-latest + # Needs to run on Windows to create the installer + runs-on: windows-latest timeout-minutes: 10 permissions: From 3d8b9986583477f3f5e06c5e99b68e7c1480cc1d Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:29:58 +0300 Subject: [PATCH 3/5] Build for all supported windows platforms --- .github/workflows/main.yml | 57 +++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9671342..155d915 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,6 +72,13 @@ 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 @@ -96,7 +103,7 @@ jobs: -p:CSharpier_Bypass=true --output LightBulb/bin/publish/ --configuration Release - --runtime win-x64 + --runtime ${{ matrix.rid }} --self-contained - name: Create installer @@ -111,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: @@ -133,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 @@ -141,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 From 5e356870783e0e82653e523c09478d21e43581f0 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:39:22 +0300 Subject: [PATCH 4/5] asd --- LightBulb/Services/UpdateService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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() ); From c6372dd5430ebac54c19551a8dacb54298d836c5 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Thu, 2 May 2024 02:13:02 +0300 Subject: [PATCH 5/5] asd --- ReadMe.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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