From 164c1b862d4176879f4a4152d3baa7c7ed81cecf Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Mon, 30 Sep 2024 21:32:57 +0200 Subject: [PATCH 01/10] Use inputs instead of env --- .../workflows/build-upload-publish-dev.yml | 21 ++++++++++++------- .github/workflows/build-upload-publish.yml | 21 ++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-upload-publish-dev.yml b/.github/workflows/build-upload-publish-dev.yml index 900641cd..bc0a5b22 100644 --- a/.github/workflows/build-upload-publish-dev.yml +++ b/.github/workflows/build-upload-publish-dev.yml @@ -10,16 +10,23 @@ on: - '**/*.yml' - '**/*.yaml' workflow_dispatch: - -env: - DOTNET_VERSION: "8.0" - REPO_NAME: "jellyfin-dev" + inputs: + DOTNET_VERSION: + description: .NET version to use + type: string + default: "8.0" + required: false + REPO_NAME: + description: Repository name + type: string + default: "jellyfin-dev" + required: false jobs: test: uses: jellyfin/jellyfin-meta-plugins/.github/workflows/test.yaml@master with: - dotnet-version: ${{ env.DOTNET_VERSION }} + dotnet-version: ${{ inputs.DOTNET_VERSION }} build: uses: ./.github/workflows/build.yml @@ -29,7 +36,7 @@ jobs: needs: build uses: ./.github/workflows/upload-repo.yml with: - repo: ${{ env.REPO_NAME }} + repo: ${{ inputs.REPO_NAME }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} @@ -40,7 +47,7 @@ jobs: needs: upload-repo uses: ./.github/workflows/publish.yml with: - repo: ${{ env.REPO_NAME }} + repo: ${{ inputs.REPO_NAME }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} diff --git a/.github/workflows/build-upload-publish.yml b/.github/workflows/build-upload-publish.yml index d447ff49..a8d72fed 100644 --- a/.github/workflows/build-upload-publish.yml +++ b/.github/workflows/build-upload-publish.yml @@ -6,16 +6,23 @@ on: types: - released workflow_dispatch: - -env: - DOTNET_VERSION: "8.0" - REPO_NAME: "jellyfin" + inputs: + DOTNET_VERSION: + description: .NET version to use + type: string + default: "8.0" + required: false + REPO_NAME: + description: Repository name + type: string + default: "jellyfin-dev" + required: false jobs: test: uses: jellyfin/jellyfin-meta-plugins/.github/workflows/test.yaml@master with: - dotnet-version: ${{ env.DOTNET_VERSION }} + dotnet-version: ${{ inputs.DOTNET_VERSION }} build: needs: test @@ -30,7 +37,7 @@ jobs: needs: build uses: ./.github/workflows/upload-repo.yml with: - repo: ${{ env.REPO_NAME }} + repo: ${{ inputs.REPO_NAME }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} @@ -41,7 +48,7 @@ jobs: needs: upload-repo uses: ./.github/workflows/publish.yml with: - repo: ${{ env.REPO_NAME }} + repo: ${{ inputs.REPO_NAME }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} From 9b8b83609bf08d38bfcbdc7e2948e697810a28cc Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Mon, 30 Sep 2024 21:54:17 +0200 Subject: [PATCH 02/10] Simulate code change --- src/Jellyfin.Plugin.ListenBrainz/Plugin.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs index ed3213a6..cc41ca73 100644 --- a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs +++ b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs @@ -136,9 +136,17 @@ public static string GetDataPath() public static string GetConfigDirPath() { var path = _thisInstance?.ConfigurationFilePath; - if (path is null) throw new PluginException("Plugin instance is not available"); + if (path is null) + { + throw new PluginException("Plugin instance is not available"); + } + var dirName = Path.GetDirectoryName(path); - if (dirName is null) throw new PluginException("Could not get a config directory name"); + if (dirName is null) + { + throw new PluginException("Could not get a config directory name"); + } + return dirName; } From 13fd3ab23887eef6fa2c5edfcdd9bb6d0ce3c101 Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Mon, 30 Sep 2024 23:02:41 +0200 Subject: [PATCH 03/10] Try using repo variables --- .github/workflows/build-upload-publish-dev.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-upload-publish-dev.yml b/.github/workflows/build-upload-publish-dev.yml index bc0a5b22..f2d139fe 100644 --- a/.github/workflows/build-upload-publish-dev.yml +++ b/.github/workflows/build-upload-publish-dev.yml @@ -10,23 +10,12 @@ on: - '**/*.yml' - '**/*.yaml' workflow_dispatch: - inputs: - DOTNET_VERSION: - description: .NET version to use - type: string - default: "8.0" - required: false - REPO_NAME: - description: Repository name - type: string - default: "jellyfin-dev" - required: false jobs: test: uses: jellyfin/jellyfin-meta-plugins/.github/workflows/test.yaml@master with: - dotnet-version: ${{ inputs.DOTNET_VERSION }} + dotnet-version: ${{ env.DOTNET_8 }} build: uses: ./.github/workflows/build.yml @@ -36,7 +25,7 @@ jobs: needs: build uses: ./.github/workflows/upload-repo.yml with: - repo: ${{ inputs.REPO_NAME }} + repo: ${{ env.REPO_DEV }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} @@ -47,7 +36,7 @@ jobs: needs: upload-repo uses: ./.github/workflows/publish.yml with: - repo: ${{ inputs.REPO_NAME }} + repo: ${{ env.REPO_DEV }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} From ef90e3e07071aacea86ef84c7977c99c6fa2bb6b Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Mon, 30 Sep 2024 23:03:52 +0200 Subject: [PATCH 04/10] Trigger CI --- src/Jellyfin.Plugin.ListenBrainz/Plugin.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs index cc41ca73..db152e3f 100644 --- a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs +++ b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs @@ -124,7 +124,11 @@ public static string GetDataPath() // var path = _thisInstance?.DataFolderPath; var pluginDirName = string.Format(CultureInfo.InvariantCulture, "{0}_{1}", _thisInstance?.Name, Version); var path = Path.Join(_thisInstance?.ApplicationPaths.PluginsPath, pluginDirName); - if (path is null) throw new PluginException("Plugin instance is not available"); + if (path is null) + { + throw new PluginException("Plugin instance is not available"); + } + return path; } From dce2aff836cd28c454efb8d1bb4eac409a406d96 Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Mon, 30 Sep 2024 23:07:29 +0200 Subject: [PATCH 05/10] Use vars context --- .github/workflows/build-upload-publish-dev.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-upload-publish-dev.yml b/.github/workflows/build-upload-publish-dev.yml index f2d139fe..34592168 100644 --- a/.github/workflows/build-upload-publish-dev.yml +++ b/.github/workflows/build-upload-publish-dev.yml @@ -15,7 +15,7 @@ jobs: test: uses: jellyfin/jellyfin-meta-plugins/.github/workflows/test.yaml@master with: - dotnet-version: ${{ env.DOTNET_8 }} + dotnet-version: ${{ vars.DOTNET_8 }} build: uses: ./.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: needs: build uses: ./.github/workflows/upload-repo.yml with: - repo: ${{ env.REPO_DEV }} + repo: ${{ vars.REPO_DEV }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} @@ -36,7 +36,7 @@ jobs: needs: upload-repo uses: ./.github/workflows/publish.yml with: - repo: ${{ env.REPO_DEV }} + repo: ${{ vars.REPO_DEV }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} From 35fce7773fb6829a6c8a0ac55d6bdc7b45bdd4af Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Mon, 30 Sep 2024 23:08:05 +0200 Subject: [PATCH 06/10] Trigger CI --- src/Jellyfin.Plugin.ListenBrainz/Plugin.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs index db152e3f..e1b64333 100644 --- a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs +++ b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs @@ -109,7 +109,11 @@ public IEnumerable GetPages() public static PluginConfiguration GetConfiguration() { var config = _thisInstance?.Configuration; - if (config is not null) return config; + if (config is not null) + { + return config; + } + throw new PluginException("Plugin instance is not available"); } From c1a61690802bfe1f43c58908894c17cf55f0e43f Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Mon, 30 Sep 2024 23:16:10 +0200 Subject: [PATCH 07/10] Fix workflow --- .github/workflows/build-upload-publish.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-upload-publish.yml b/.github/workflows/build-upload-publish.yml index a8d72fed..4220e38b 100644 --- a/.github/workflows/build-upload-publish.yml +++ b/.github/workflows/build-upload-publish.yml @@ -6,23 +6,12 @@ on: types: - released workflow_dispatch: - inputs: - DOTNET_VERSION: - description: .NET version to use - type: string - default: "8.0" - required: false - REPO_NAME: - description: Repository name - type: string - default: "jellyfin-dev" - required: false jobs: test: uses: jellyfin/jellyfin-meta-plugins/.github/workflows/test.yaml@master with: - dotnet-version: ${{ inputs.DOTNET_VERSION }} + dotnet-version: ${{ vars.DOTNET_8 }} build: needs: test @@ -37,7 +26,7 @@ jobs: needs: build uses: ./.github/workflows/upload-repo.yml with: - repo: ${{ inputs.REPO_NAME }} + repo: ${{ vars.REPO_DEFAULT }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} @@ -48,7 +37,7 @@ jobs: needs: upload-repo uses: ./.github/workflows/publish.yml with: - repo: ${{ inputs.REPO_NAME }} + repo: ${{ vars.REPO_DEFAULT }} secrets: host: ${{ secrets.DEPLOY_HOST }} user: ${{ secrets.DEPLOY_USER }} From 8d7cb734a5c1735a1173bf39a56c5520532055df Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Tue, 1 Oct 2024 20:06:24 +0200 Subject: [PATCH 08/10] Revert "Trigger CI" This reverts commit 35fce7773fb6829a6c8a0ac55d6bdc7b45bdd4af. --- src/Jellyfin.Plugin.ListenBrainz/Plugin.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs index e1b64333..db152e3f 100644 --- a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs +++ b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs @@ -109,11 +109,7 @@ public IEnumerable GetPages() public static PluginConfiguration GetConfiguration() { var config = _thisInstance?.Configuration; - if (config is not null) - { - return config; - } - + if (config is not null) return config; throw new PluginException("Plugin instance is not available"); } From 311eb3acbda28bd59db8e335bd540272bed77c6a Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Tue, 1 Oct 2024 20:06:29 +0200 Subject: [PATCH 09/10] Revert "Trigger CI" This reverts commit ef90e3e07071aacea86ef84c7977c99c6fa2bb6b. --- src/Jellyfin.Plugin.ListenBrainz/Plugin.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs index db152e3f..cc41ca73 100644 --- a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs +++ b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs @@ -124,11 +124,7 @@ public static string GetDataPath() // var path = _thisInstance?.DataFolderPath; var pluginDirName = string.Format(CultureInfo.InvariantCulture, "{0}_{1}", _thisInstance?.Name, Version); var path = Path.Join(_thisInstance?.ApplicationPaths.PluginsPath, pluginDirName); - if (path is null) - { - throw new PluginException("Plugin instance is not available"); - } - + if (path is null) throw new PluginException("Plugin instance is not available"); return path; } From d48b154e3ca591f13c8bf5644ba305c56174dfc7 Mon Sep 17 00:00:00 2001 From: Dominik Krivohlavek Date: Tue, 1 Oct 2024 20:06:36 +0200 Subject: [PATCH 10/10] Revert "Simulate code change" This reverts commit 9b8b83609bf08d38bfcbdc7e2948e697810a28cc. --- src/Jellyfin.Plugin.ListenBrainz/Plugin.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs index cc41ca73..ed3213a6 100644 --- a/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs +++ b/src/Jellyfin.Plugin.ListenBrainz/Plugin.cs @@ -136,17 +136,9 @@ public static string GetDataPath() public static string GetConfigDirPath() { var path = _thisInstance?.ConfigurationFilePath; - if (path is null) - { - throw new PluginException("Plugin instance is not available"); - } - + if (path is null) throw new PluginException("Plugin instance is not available"); var dirName = Path.GetDirectoryName(path); - if (dirName is null) - { - throw new PluginException("Could not get a config directory name"); - } - + if (dirName is null) throw new PluginException("Could not get a config directory name"); return dirName; }