From bebefd4440386f954c9b1b8cd3240c4812050998 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Mon, 11 Dec 2023 18:24:54 +0100 Subject: [PATCH] CI: Expose detected plugin name to other workflow jobs --- .github/workflows/build-project.yaml | 14 ++++++++++++++ .github/workflows/push.yaml | 2 +- buildspec.json | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 8f29b9a5..6425a51f 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -1,6 +1,10 @@ name: Build Project on: workflow_call: + outputs: + pluginName: + description: 'Project name detected by parsing build spec file' + value: ${{ jobs.check-event.outputs.pluginName }} jobs: check-event: name: Check GitHub Event Data 🔎 @@ -14,6 +18,7 @@ jobs: notarize: ${{ steps.setup.outputs.notarize }} config: ${{ steps.setup.outputs.config }} commitHash: ${{ steps.setup.outputs.commitHash }} + pluginName: ${{ steps.setup.outputs.pluginName }} steps: - uses: actions/checkout@v3 with: @@ -57,6 +62,15 @@ jobs: done echo "commitHash=${GITHUB_SHA:0:9}" >> $GITHUB_OUTPUT + plugin_name="$(grep 'name' buildspec.json | sed -E -e 's/^.+"name":[^"]+"(.+)",?$/\1/g')" + plugin_display_name="$(grep 'displayName' buildspec.json | sed -E -e 's/^.+"displayName":[^"]+"(.+)",?$/\1/g' || echo "")" + + if [[ "${plugin_display_name}" ]]; then + echo "pluginName=${plugin_display_name}" >> $GITHUB_OUTPUT + else + echo "pluginName=${plugin_name}" >> $GITHUB_OUTPUT + fi + macos-build: name: Build for macOS 🍏 runs-on: macos-13 diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 9e768551..58fe69bb 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -111,7 +111,7 @@ jobs: draft: true prerelease: ${{ fromJSON(steps.check.outputs.prerelease) }} tag_name: ${{ steps.check.outputs.version }} - name: OBS Studio ${{ steps.check.outputs.version }} + name: ${{ needs.build-project.outputs.pluginName }} ${{ steps.check.outputs.version }} body_path: ${{ github.workspace }}/CHECKSUMS.txt files: | ${{ github.workspace }}/*.exe diff --git a/buildspec.json b/buildspec.json index d87180c8..b1948818 100644 --- a/buildspec.json +++ b/buildspec.json @@ -37,6 +37,7 @@ } }, "name": "obs-plugintemplate", + "displayName": "OBS Plugin Template", "version": "1.0.0", "author": "Your Name Here", "website": "https://example.com",