From 09ddaf2a08101cbf49623f73f478b53b7e6373a8 Mon Sep 17 00:00:00 2001 From: Ionite Date: Fri, 4 Aug 2023 15:10:49 -0400 Subject: [PATCH 1/5] Allow missing commits for sentry release --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80287394d..5054d4069 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,6 +92,7 @@ jobs: with: environment: production ignore_missing: true + ignore-empty: true version: StabilityMatrix.Avalonia@${{ env.GIT_TAG_NAME }} - name: Create Sentry release From 5cff99c5116a723d975078e6cb4e5f0d9ae6f379 Mon Sep 17 00:00:00 2001 From: Ionite Date: Fri, 4 Aug 2023 15:13:04 -0400 Subject: [PATCH 2/5] Fix ignore_missing casing and removed duplicate --- .github/workflows/release.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5054d4069..5abe1f559 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,21 +82,7 @@ jobs: path: ${{ env.out-name }} - name: Create Sentry release - if: ${{ github.event_name == 'release' || github.event.inputs.sentry-release == 'true' }} - uses: getsentry/action-release@v1 - env: - MAKE_SENTRY_RELEASE: ${{ secrets.SENTRY_PROJECT != '' }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - with: - environment: production - ignore_missing: true - ignore-empty: true - version: StabilityMatrix.Avalonia@${{ env.GIT_TAG_NAME }} - - - name: Create Sentry release - if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ github.event.inputs.sentry-release == 'true' }} uses: getsentry/action-release@v1 env: MAKE_SENTRY_RELEASE: ${{ secrets.SENTRY_PROJECT != '' }} @@ -106,8 +92,9 @@ jobs: with: environment: production ignore_missing: true + ignore_empty: true version: StabilityMatrix.Avalonia@${{ github.event.inputs.version }} - + release-windows: name: Release (win-x64) From bfcbdbda533b803c9f0064a1f950d6cf26d11c34 Mon Sep 17 00:00:00 2001 From: Ionite Date: Thu, 10 Aug 2023 16:45:56 -0400 Subject: [PATCH 3/5] Add contents write permission to release CI --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5abe1f559..cbbb9c89a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,8 @@ name: Release +permissions: + contents: write + on: workflow_dispatch: inputs: From d6ef45dbe1d40c515d7c805eaf24af72622f0f7e Mon Sep 17 00:00:00 2001 From: Jacob McSwain Date: Fri, 1 Sep 2023 14:38:00 -0500 Subject: [PATCH 4/5] Fix 7zzs binary permissions The AppImage release of v2.3.3 errors while installing A1111 with `An error occurred trying to start process '/home/user/Applications/Data/Assets/7zzs' with working directory '/home/user/Applications'. Permission denied` The permissions applied were `-r----x--t`. I found a typo in the permissions, but also the `UnixFileMode` (https://learn.microsoft.com/en-us/dotnet/api/system.io.unixfilemode) is an enum which doesn't seem to cast from typical values like 0777. I also noticed the permissions were intended to be _quite_ permissive. This change also prevents `group` and `all` writes. --- StabilityMatrix.Avalonia/Assets.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/StabilityMatrix.Avalonia/Assets.cs b/StabilityMatrix.Avalonia/Assets.cs index 8e11c868b..c5d6def85 100644 --- a/StabilityMatrix.Avalonia/Assets.cs +++ b/StabilityMatrix.Avalonia/Assets.cs @@ -25,6 +25,11 @@ internal static class Assets public static AvaloniaResource LicensesJson => new( "avares://StabilityMatrix.Avalonia/Assets/licenses.json"); + private const UnixFileMode unix755 = UnixFileMode.UserRead | UnixFileMode.UserWrite | + UnixFileMode.UserExecute | UnixFileMode.GroupRead | + UnixFileMode.GroupExecute | UnixFileMode.OtherRead | + UnixFileMode.OtherExecute; + [SupportedOSPlatform("windows")] [SupportedOSPlatform("linux")] [SupportedOSPlatform("macos")] @@ -32,9 +37,9 @@ internal static class Assets (PlatformKind.Windows, new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/win-x64/7za.exe")), (PlatformKind.Linux | PlatformKind.X64, - new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs", (UnixFileMode) 0777)), + new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs", unix755)), (PlatformKind.MacOS | PlatformKind.Arm, - new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/macos-arm64/7zz", (UnixFileMode) 0x777))); + new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/macos-arm64/7zz", unix755))); [SupportedOSPlatform("windows")] [SupportedOSPlatform("linux")] From d03e47aeeb51d90e9fedd97ea6890426bf30c4a3 Mon Sep 17 00:00:00 2001 From: Jacob McSwain Date: Fri, 1 Sep 2023 15:10:58 -0500 Subject: [PATCH 5/5] Fix other erroneous casts of UnixFileMode --- StabilityMatrix.Avalonia/Program.cs | 6 +++++- .../ViewModels/Dialogs/UpdateViewModel.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/StabilityMatrix.Avalonia/Program.cs b/StabilityMatrix.Avalonia/Program.cs index c693b2243..0c2ba3864 100644 --- a/StabilityMatrix.Avalonia/Program.cs +++ b/StabilityMatrix.Avalonia/Program.cs @@ -107,7 +107,11 @@ private static void HandleUpdateReplacement() // Ensure permissions are set for unix if (Compat.IsUnix) { - File.SetUnixFileMode(targetExe, (UnixFileMode) 0x755); + File.SetUnixFileMode(targetExe, // 0755 + UnixFileMode.UserRead | UnixFileMode.UserWrite | + UnixFileMode.UserExecute | UnixFileMode.GroupRead | + UnixFileMode.GroupExecute | UnixFileMode.OtherRead | + UnixFileMode.OtherExecute); } // Start the new app diff --git a/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs index 22a6b9ab0..02e4d213c 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs @@ -97,7 +97,11 @@ private async Task InstallUpdate() // On unix, we need to set the executable bit if (Compat.IsUnix) { - File.SetUnixFileMode(UpdateHelper.ExecutablePath, (UnixFileMode) 0x755); + File.SetUnixFileMode(UpdateHelper.ExecutablePath, // 0755 + UnixFileMode.UserRead | UnixFileMode.UserWrite | + UnixFileMode.UserExecute | UnixFileMode.GroupRead | + UnixFileMode.GroupExecute | UnixFileMode.OtherRead | + UnixFileMode.OtherExecute); } UpdateText = "Update complete. Restarting Stability Matrix in 3 seconds...";