diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 4957eab..6904c7c 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -78,8 +78,11 @@ jobs: - name: Restore the application run: dotnet restore + # We copy the contributors to the "env:Configuration" result, the origin path is now hardcoded so if ever the repo name changes this needs to be changed too - name: Publish - run: dotnet publish --configuration $env:Configuration --output ./$env:Configuration -r win-x64 /p:Platform=x64 + run: | + dotnet publish --configuration $env:Configuration --output ./$env:Configuration -r win-x64 /p:Platform=x64 + copy D:/a/WinDurango.UI/WinDurango.UI/Assets/contributors.txt ./$env:Configuration/Assets/contributors.txt env: Configuration: ${{ matrix.configuration }} diff --git a/BuildScripts/build.bat b/BuildScripts/build.bat index 8b668d0..858049b 100644 --- a/BuildScripts/build.bat +++ b/BuildScripts/build.bat @@ -1,4 +1,4 @@ -python -m venv BuildScripts\venv -BuildScripts\venv\Scripts\activate +python -m venv .\venv +call .\venv\Scripts\activate pip install requests -py BuildScripts\contributors.py \ No newline at end of file +py .\contributors.py diff --git a/BuildScripts/contributors.py b/BuildScripts/contributors.py index 6f920aa..1a1c9c3 100644 --- a/BuildScripts/contributors.py +++ b/BuildScripts/contributors.py @@ -1,7 +1,7 @@ import json import os -f = open('Assets/contributors.txt', 'w+') +f = open(os.path.join(os.path.dirname(__file__), "..", "Assets", "contributors.txt"), "w+") try: import requests @@ -27,6 +27,8 @@ print("Couldn't fetch contributor information.") exit(0) + + f.close() diff --git a/Pages/AboutPage.xaml.cs b/Pages/AboutPage.xaml.cs index 6ba5b47..43e3a38 100644 --- a/Pages/AboutPage.xaml.cs +++ b/Pages/AboutPage.xaml.cs @@ -14,16 +14,19 @@ public AboutPage() { this.InitializeComponent(); - string[] lines = File.ReadAllLines("Assets/contributors.txt"); - foreach (var contributor in lines) + if (File.Exists("Assets/contributors.txt")) { - string[] info = contributor.Split(";"); - string name = info[0].Replace("WD_CONTRIB_SEMICOLON", ";"); - string avatar = info[1].Replace("WD_CONTRIB_SEMICOLON", ";"); - string link = info[2].Replace("WD_CONTRIB_SEMICOLON", ";"); - string contributionCount = info[3]; + string[] lines = File.ReadAllLines("Assets/contributors.txt"); + foreach (var contributor in lines) + { + string[] info = contributor.Split(";"); + string name = info[0].Replace("WD_CONTRIB_SEMICOLON", ";"); + string avatar = info[1].Replace("WD_CONTRIB_SEMICOLON", ";"); + string link = info[2].Replace("WD_CONTRIB_SEMICOLON", ";"); + string contributionCount = info[3]; - contributorList.Children.Add(new ContributorInfo(name, avatar, link)); + contributorList.Children.Add(new ContributorInfo(name, avatar, link)); + } } } } diff --git a/WinDurango.csproj b/WinDurango.csproj index 002744d..7473fa7 100644 --- a/WinDurango.csproj +++ b/WinDurango.csproj @@ -229,6 +229,7 @@ - + +