From ea0b4e6f0945be882f2a47afa78f51a0aaa5fc30 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:18:01 +0100 Subject: [PATCH 01/16] Add version for nigly build --- .github/workflows/create-latest-develop-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-latest-develop-build.yml b/.github/workflows/create-latest-develop-build.yml index b7e8907..47c9e79 100644 --- a/.github/workflows/create-latest-develop-build.yml +++ b/.github/workflows/create-latest-develop-build.yml @@ -84,9 +84,9 @@ jobs: - name: Restore dependencies run: dotnet restore - name: Publish Application - run: dotnet publish ${{ env.APPLICATION_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} + run: dotnet publish ${{ env.APPLICATION_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} -p:Version=0.0.0 - name: Publish Plugin - run: dotnet publish ${{ env.APPLICATION_PLUGIN_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.PLUGIN_PUBLISH_FOLDER }} /p:DebugType=None /p:DebugSymbols=false + run: dotnet publish ${{ env.APPLICATION_PLUGIN_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.PLUGIN_PUBLISH_FOLDER }} /p:DebugType=None /p:DebugSymbols=false -p:Version=0.0.0 - name: Show content for debug if: ${{ env.DEBUG == 'true' }} run: ls @@ -118,9 +118,9 @@ jobs: - name: Restore dependencies run: dotnet restore - name: Publish Application - run: dotnet publish $APPLICATION_PROJECT_PATH -r linux-x64 -c Release -o $APPLICATION_PUBLISH_FOLDER + run: dotnet publish $APPLICATION_PROJECT_PATH -r linux-x64 -c Release -o $APPLICATION_PUBLISH_FOLDER -p:Version=0.0.0 - name: Publish Plugin - run: dotnet publish $APPLICATION_PLUGIN_PROJECT_PATH -r linux-x64 -c Release -o $PLUGIN_PUBLISH_FOLDER /p:DebugType=None /p:DebugSymbols=false + run: dotnet publish $APPLICATION_PLUGIN_PROJECT_PATH -r linux-x64 -c Release -o $PLUGIN_PUBLISH_FOLDER /p:DebugType=None /p:DebugSymbols=false -p:Version=0.0.0 - name: Show content for debug if: ${{ env.DEBUG == 'true' }} run: ls -la From d3cf9bb66798d9db95c45930e75fafb098288aea Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:18:17 +0100 Subject: [PATCH 02/16] Add code for building live --- .github/workflows/create-live-build.yml | 155 ++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 .github/workflows/create-live-build.yml diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml new file mode 100644 index 0000000..0657de8 --- /dev/null +++ b/.github/workflows/create-live-build.yml @@ -0,0 +1,155 @@ +name: Live build + +# Based on https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release +on: + release: + types: [released] + push: + +env: + DEBUG: true + REF_CHECKOUT_BRANCH: develop + RELEASE_NAME: Recent nightly build + APPLICATION_PROJECT_PATH: .\src\ModularToolManager\ModularToolManager.csproj + APPLICATION_PLUGIN_PROJECT_PATH: .\src\DefaultPlugins\DefaultPlugins.csproj + APPLICATION_PUBLISH_FOLDER: ./publish + PLUGIN_PUBLISH_FOLDER: ./publish/plugins + WINDOWS_ARTIFACT_NAME: WindowsBuildArtifact_x64 + LINUX_ARTIFACT_NAME: LinuxBuildArtifact_x64 + RELEASE_ARTIFACT_FOLDER: artifacts + +jobs: + check-build: + name: Check and Test build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ env.REF_CHECKOUT_BRANCH }} + lfs: true + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 7.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal + get-build-version: + name: Get version for build + runs-on: windows-latest + outputs: + build-version: ${{ steps.get-build-version.outputs.build-version }} + steps: + - name: Get release version + id: get-build-version + run: | + # Found at https://github.com/orgs/community/discussions/25713 + # Additional env fix found on https://github.com/actions/runner-images/issues/5251 + if ( '${{ GITHUB.REF_TYPE }}' -eq 'branch' ) { + echo "BUILD_VERSION=0.0.0" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + } + else { + echo "BUILD_VERSION=${{ GITHUB.REF_NAME }}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + } + create-windows-build: + name: Create Windows build + if: needs.check-for-changes.outputs.should-run == 'true' + needs: ["check-build"] + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ env.REF_CHECKOUT_BRANCH }} + lfs: true + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Publish Application + run: dotnet publish ${{ env.APPLICATION_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} -p:Version=${{ steps.get-build-version.outputs.build-version }} + - name: Publish Plugin + run: dotnet publish ${{ env.APPLICATION_PLUGIN_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.PLUGIN_PUBLISH_FOLDER }} /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ steps.get-build-version.outputs.build-version }} + - name: Show content for debug + if: ${{ env.DEBUG == 'true' }} + run: ls + - name: Show content to publish + if: ${{ env.DEBUG == 'true' }} + run: | + cd ./publish + ls + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.WINDOWS_ARTIFACT_NAME }} + path: ${{ env.APPLICATION_PUBLISH_FOLDER }} + if-no-files-found: error + create-linux-build: + name: Create Linux build + if: needs.check-for-changes.outputs.should-run == 'true' + needs: ["check-build"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ env.REF_CHECKOUT_BRANCH }} + lfs: true + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Publish Application + run: dotnet publish $APPLICATION_PROJECT_PATH -r linux-x64 -c Release -o $APPLICATION_PUBLISH_FOLDER -p:Version=${{ steps.get-build-version.outputs.build-version }} + - name: Publish Plugin + run: dotnet publish $APPLICATION_PLUGIN_PROJECT_PATH -r linux-x64 -c Release -o $PLUGIN_PUBLISH_FOLDER /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ steps.get-build-version.outputs.build-version }} + - name: Show content for debug + if: ${{ env.DEBUG == 'true' }} + run: ls -la + - name: Show content to publish + if: ${{ env.DEBUG == 'true' }} + run: | + cd ./publish + ls -la + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.LINUX_ARTIFACT_NAME }} + path: ${{ env.APPLICATION_PUBLISH_FOLDER }} + if-no-files-found: error + upload-release: + name: Upload Artifacts to release + needs: ["create-windows-build", "create-linux-build"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ env.REF_CHECKOUT_BRANCH }} + lfs: true + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + path: ${{ env.RELEASE_ARTIFACT_FOLDER }} + - name: Zip Windows build + run: | + cd ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_ARTIFACT_NAME + zip -r $WINDOWS_ARTIFACT_NAME.zip ./* + mv $WINDOWS_ARTIFACT_NAME.zip ../ + rm -rf ./../$WINDOWS_ARTIFACT_NAME + - name: Move nuget tool + run: | + mv ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_NUGET_ARTIFACT_NAME/IL2CareerToolset*.nupkg ./$RELEASE_ARTIFACT_FOLDER + rm -rf ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_NUGET_ARTIFACT_NAME/ + - name: Display artifacts folder content + if: ${{ env.DEBUG == 'true' }} + run: ls -la $RELEASE_ARTIFACT_FOLDER + - name: Upload artifacts + if: ${{ env.DEBUG == 'false' }} + run: | + gh release upload ${{ GITHUB.REF_NAME }} ${{ env.RELEASE_ARTIFACT_FOLDER }}/*.zip + #gh release upload ${{ GITHUB.REF_NAME }} ${{ env.RELEASE_ARTIFACT_FOLDER }}/*.nupkg From f1c7babe7ba479f031c8d2f1d2a57011e49d1dd7 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:18:26 +0100 Subject: [PATCH 03/16] Add pipelines to vs view --- ModularToolManagerProject.sln | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ModularToolManagerProject.sln b/ModularToolManagerProject.sln index c742a1e..838158e 100644 --- a/ModularToolManagerProject.sln +++ b/ModularToolManagerProject.sln @@ -6,6 +6,8 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BE409F60-F5A2-4643-B028-F124F6CC151A}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore + .github\workflows\create-latest-develop-build.yml = .github\workflows\create-latest-develop-build.yml + .github\workflows\create-live-build.yml = .github\workflows\create-live-build.yml README.md = README.md EndProjectSection EndProject From fe036351ccec1bff8cbbc668a1a0e7b78210f2d4 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:19:22 +0100 Subject: [PATCH 04/16] Fix pipeline step order --- .github/workflows/create-live-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index 0657de8..ffe11da 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -57,7 +57,7 @@ jobs: create-windows-build: name: Create Windows build if: needs.check-for-changes.outputs.should-run == 'true' - needs: ["check-build"] + needs: ["check-build", "get-build-version"] runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -91,7 +91,7 @@ jobs: create-linux-build: name: Create Linux build if: needs.check-for-changes.outputs.should-run == 'true' - needs: ["check-build"] + needs: ["check-build", "get-build-version"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 54040a7920fcfb0df6b3478b16431a9bac260e63 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:24:49 +0100 Subject: [PATCH 05/16] Remove wrong if conditions --- .github/workflows/create-live-build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index ffe11da..b45fcc3 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -56,7 +56,6 @@ jobs: } create-windows-build: name: Create Windows build - if: needs.check-for-changes.outputs.should-run == 'true' needs: ["check-build", "get-build-version"] runs-on: windows-latest steps: @@ -90,7 +89,6 @@ jobs: if-no-files-found: error create-linux-build: name: Create Linux build - if: needs.check-for-changes.outputs.should-run == 'true' needs: ["check-build", "get-build-version"] runs-on: ubuntu-latest steps: From 84044d6c6658dd048702782697481c05b069e3e0 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:25:17 +0100 Subject: [PATCH 06/16] Switch build step to ubuntu for performance --- .github/workflows/create-live-build.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index b45fcc3..8a639b4 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -39,7 +39,7 @@ jobs: run: dotnet test --no-build --verbosity normal get-build-version: name: Get version for build - runs-on: windows-latest + runs-on: ubuntu-22.04 outputs: build-version: ${{ steps.get-build-version.outputs.build-version }} steps: @@ -48,12 +48,14 @@ jobs: run: | # Found at https://github.com/orgs/community/discussions/25713 # Additional env fix found on https://github.com/actions/runner-images/issues/5251 - if ( '${{ GITHUB.REF_TYPE }}' -eq 'branch' ) { - echo "BUILD_VERSION=0.0.0" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append - } - else { - echo "BUILD_VERSION=${{ GITHUB.REF_NAME }}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append - } + if [ 'branch' == 'branch' ] + then + echo "Running on branch (Check successful)" + echo "build-version=${{ GITHUB.REF_NAME }}" >> $GITHUB_OUTPUT + else + echo "Is not running on branch (Check failed)" + echo "build-version=0.0.0" >> $GITHUB_OUTPUT + fi create-windows-build: name: Create Windows build needs: ["check-build", "get-build-version"] From 45edbc4ab40c1119cdf5367b87dca162668f08a9 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:29:57 +0100 Subject: [PATCH 07/16] Try to fix output --- .github/workflows/create-live-build.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index 8a639b4..dd94b5e 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -37,14 +37,14 @@ jobs: run: dotnet build --no-restore - name: Test run: dotnet test --no-build --verbosity normal - get-build-version: + build-version: name: Get version for build runs-on: ubuntu-22.04 outputs: - build-version: ${{ steps.get-build-version.outputs.build-version }} + build-version: ${{ steps.build-version.outputs.build-version }} steps: - name: Get release version - id: get-build-version + id: build-version run: | # Found at https://github.com/orgs/community/discussions/25713 # Additional env fix found on https://github.com/actions/runner-images/issues/5251 @@ -58,7 +58,7 @@ jobs: fi create-windows-build: name: Create Windows build - needs: ["check-build", "get-build-version"] + needs: ["check-build", "build-version"] runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -72,9 +72,9 @@ jobs: - name: Restore dependencies run: dotnet restore - name: Publish Application - run: dotnet publish ${{ env.APPLICATION_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} -p:Version=${{ steps.get-build-version.outputs.build-version }} + run: dotnet publish ${{ env.APPLICATION_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} -p:Version=${{ steps.build-version.outputs.build-version }} - name: Publish Plugin - run: dotnet publish ${{ env.APPLICATION_PLUGIN_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.PLUGIN_PUBLISH_FOLDER }} /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ steps.get-build-version.outputs.build-version }} + run: dotnet publish ${{ env.APPLICATION_PLUGIN_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.PLUGIN_PUBLISH_FOLDER }} /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ steps.build-version.outputs.build-version }} - name: Show content for debug if: ${{ env.DEBUG == 'true' }} run: ls @@ -91,7 +91,7 @@ jobs: if-no-files-found: error create-linux-build: name: Create Linux build - needs: ["check-build", "get-build-version"] + needs: ["check-build", "build-version"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -105,9 +105,9 @@ jobs: - name: Restore dependencies run: dotnet restore - name: Publish Application - run: dotnet publish $APPLICATION_PROJECT_PATH -r linux-x64 -c Release -o $APPLICATION_PUBLISH_FOLDER -p:Version=${{ steps.get-build-version.outputs.build-version }} + run: dotnet publish $APPLICATION_PROJECT_PATH -r linux-x64 -c Release -o $APPLICATION_PUBLISH_FOLDER -p:Version=${{ steps.build-version.outputs.build-version }} - name: Publish Plugin - run: dotnet publish $APPLICATION_PLUGIN_PROJECT_PATH -r linux-x64 -c Release -o $PLUGIN_PUBLISH_FOLDER /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ steps.get-build-version.outputs.build-version }} + run: dotnet publish $APPLICATION_PLUGIN_PROJECT_PATH -r linux-x64 -c Release -o $PLUGIN_PUBLISH_FOLDER /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ steps.build-version.outputs.build-version }} - name: Show content for debug if: ${{ env.DEBUG == 'true' }} run: ls -la From 29329de87f4ac60a1a92fa1480af98dede6540a6 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:32:38 +0100 Subject: [PATCH 08/16] Using correct recieve syntax --- .github/workflows/create-live-build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index dd94b5e..4240060 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -71,10 +71,11 @@ jobs: dotnet-version: 6.0.x - name: Restore dependencies run: dotnet restore + # Important for using outputs in other steps https://tech.europace.de/post/github-actions-output-variables-how-to/#get-output-values-between-steps - name: Publish Application - run: dotnet publish ${{ env.APPLICATION_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} -p:Version=${{ steps.build-version.outputs.build-version }} + run: dotnet publish ${{ env.APPLICATION_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.APPLICATION_PUBLISH_FOLDER }} -p:Version=${{ needs.build-version.outputs.build-version }} - name: Publish Plugin - run: dotnet publish ${{ env.APPLICATION_PLUGIN_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.PLUGIN_PUBLISH_FOLDER }} /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ steps.build-version.outputs.build-version }} + run: dotnet publish ${{ env.APPLICATION_PLUGIN_PROJECT_PATH }} -r win-x64 -c Release -o ${{ env.PLUGIN_PUBLISH_FOLDER }} /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ needs.build-version.outputs.build-version }} - name: Show content for debug if: ${{ env.DEBUG == 'true' }} run: ls @@ -105,9 +106,9 @@ jobs: - name: Restore dependencies run: dotnet restore - name: Publish Application - run: dotnet publish $APPLICATION_PROJECT_PATH -r linux-x64 -c Release -o $APPLICATION_PUBLISH_FOLDER -p:Version=${{ steps.build-version.outputs.build-version }} + run: dotnet publish $APPLICATION_PROJECT_PATH -r linux-x64 -c Release -o $APPLICATION_PUBLISH_FOLDER -p:Version=${{ needs.build-version.outputs.build-version }} - name: Publish Plugin - run: dotnet publish $APPLICATION_PLUGIN_PROJECT_PATH -r linux-x64 -c Release -o $PLUGIN_PUBLISH_FOLDER /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ steps.build-version.outputs.build-version }} + run: dotnet publish $APPLICATION_PLUGIN_PROJECT_PATH -r linux-x64 -c Release -o $PLUGIN_PUBLISH_FOLDER /p:DebugType=None /p:DebugSymbols=false -p:Version=${{ needs.build-version.outputs.build-version }} - name: Show content for debug if: ${{ env.DEBUG == 'true' }} run: ls -la From aa310d3f0d49182b8b4c59e30e642df64749d9f7 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:34:45 +0100 Subject: [PATCH 09/16] Use correct term for getting version --- .github/workflows/create-live-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index 4240060..acd941a 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -48,7 +48,7 @@ jobs: run: | # Found at https://github.com/orgs/community/discussions/25713 # Additional env fix found on https://github.com/actions/runner-images/issues/5251 - if [ 'branch' == 'branch' ] + if [ '${{ GITHUB.REF_TYPE }}' == 'branch' ] then echo "Running on branch (Check successful)" echo "build-version=${{ GITHUB.REF_NAME }}" >> $GITHUB_OUTPUT From df0004c31a0eb6c059b43db5e61b56668021d001 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:35:39 +0100 Subject: [PATCH 10/16] add text for debugging --- .github/workflows/create-live-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index acd941a..00f46a3 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -48,7 +48,7 @@ jobs: run: | # Found at https://github.com/orgs/community/discussions/25713 # Additional env fix found on https://github.com/actions/runner-images/issues/5251 - if [ '${{ GITHUB.REF_TYPE }}' == 'branch' ] + if [ '${{ GITHUB.REF_TYPE }} asd' == 'branch' ] then echo "Running on branch (Check successful)" echo "build-version=${{ GITHUB.REF_NAME }}" >> $GITHUB_OUTPUT From da360f93d5a16a5c4d8cd1f2e00ab15af69a0976 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:39:03 +0100 Subject: [PATCH 11/16] Add enviroment token for github cli --- .github/workflows/create-live-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index 00f46a3..e4d14f2 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -151,6 +151,8 @@ jobs: run: ls -la $RELEASE_ARTIFACT_FOLDER - name: Upload artifacts if: ${{ env.DEBUG == 'false' }} + env: + GH_TOKEN: ${{ github.token }} run: | gh release upload ${{ GITHUB.REF_NAME }} ${{ env.RELEASE_ARTIFACT_FOLDER }}/*.zip #gh release upload ${{ GITHUB.REF_NAME }} ${{ env.RELEASE_ARTIFACT_FOLDER }}/*.nupkg From 16a8b3579607036c5fed275f9b2b703d2cc5b27e Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:39:54 +0100 Subject: [PATCH 12/16] Fix package step for release --- .github/workflows/create-live-build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index e4d14f2..3aa1bdc 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -142,10 +142,12 @@ jobs: zip -r $WINDOWS_ARTIFACT_NAME.zip ./* mv $WINDOWS_ARTIFACT_NAME.zip ../ rm -rf ./../$WINDOWS_ARTIFACT_NAME - - name: Move nuget tool + - name: Zip Linux build run: | - mv ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_NUGET_ARTIFACT_NAME/IL2CareerToolset*.nupkg ./$RELEASE_ARTIFACT_FOLDER - rm -rf ./$RELEASE_ARTIFACT_FOLDER/$WINDOWS_NUGET_ARTIFACT_NAME/ + cd ./$RELEASE_ARTIFACT_FOLDER/$LINUX_ARTIFACT_NAME + zip -r $LINUX_ARTIFACT_NAME.zip ./* + mv $LINUX_ARTIFACT_NAME.zip ../ + rm -rf ./../$LINUX_ARTIFACT_NAME - name: Display artifacts folder content if: ${{ env.DEBUG == 'true' }} run: ls -la $RELEASE_ARTIFACT_FOLDER From 239a4afb6b4a0d352ed55414f4d8a503cba8ba50 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:41:54 +0100 Subject: [PATCH 13/16] Update download action --- .github/workflows/create-live-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index 3aa1bdc..10d6a00 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -133,7 +133,7 @@ jobs: ref: ${{ env.REF_CHECKOUT_BRANCH }} lfs: true - name: Download artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: path: ${{ env.RELEASE_ARTIFACT_FOLDER }} - name: Zip Windows build From 2fe35494862c48f7f16f4a1a5e57512bff3e310c Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:44:47 +0100 Subject: [PATCH 14/16] Use correct branch --- .github/workflows/create-live-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index 10d6a00..2be23bb 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -8,8 +8,8 @@ on: env: DEBUG: true - REF_CHECKOUT_BRANCH: develop - RELEASE_NAME: Recent nightly build + REF_CHECKOUT_BRANCH: main + #RELEASE_NAME: Recent nightly build APPLICATION_PROJECT_PATH: .\src\ModularToolManager\ModularToolManager.csproj APPLICATION_PLUGIN_PROJECT_PATH: .\src\DefaultPlugins\DefaultPlugins.csproj APPLICATION_PUBLISH_FOLDER: ./publish From f30e94e6b213f34c6d3d6e229a6edbb9de83cd9e Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:44:57 +0100 Subject: [PATCH 15/16] DIsable debug --- .github/workflows/create-live-build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index 2be23bb..cbb899b 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -4,10 +4,9 @@ name: Live build on: release: types: [released] - push: env: - DEBUG: true + DEBUG: false REF_CHECKOUT_BRANCH: main #RELEASE_NAME: Recent nightly build APPLICATION_PROJECT_PATH: .\src\ModularToolManager\ModularToolManager.csproj From 219f20f0cc73c95ad0faadfcbd86bad195c099d3 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:47:02 +0100 Subject: [PATCH 16/16] Correcting if condition --- .github/workflows/create-live-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-live-build.yml b/.github/workflows/create-live-build.yml index cbb899b..93a8fc9 100644 --- a/.github/workflows/create-live-build.yml +++ b/.github/workflows/create-live-build.yml @@ -47,7 +47,7 @@ jobs: run: | # Found at https://github.com/orgs/community/discussions/25713 # Additional env fix found on https://github.com/actions/runner-images/issues/5251 - if [ '${{ GITHUB.REF_TYPE }} asd' == 'branch' ] + if [ '${{ GITHUB.REF_TYPE }}' == 'branch' ] then echo "Running on branch (Check successful)" echo "build-version=${{ GITHUB.REF_NAME }}" >> $GITHUB_OUTPUT