From 1c73b660af6aecb605e89ea3e3d67fe08edf690a Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Fri, 16 Dec 2022 17:16:37 +0300 Subject: [PATCH] Replace project and `.props` references in GH actions deploy workflow --- .github/workflows/deploy-pack.yml | 14 +++++++------- osu.Framework.Templates/replace-references.sh | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) create mode 100755 osu.Framework.Templates/replace-references.sh diff --git a/.github/workflows/deploy-pack.yml b/.github/workflows/deploy-pack.yml index 4ebbf1d11..7eeb83cb7 100644 --- a/.github/workflows/deploy-pack.yml +++ b/.github/workflows/deploy-pack.yml @@ -72,24 +72,24 @@ jobs: pack-template: name: Pack (Templates) - runs-on: windows-latest + runs-on: ubuntu-latest needs: [check-if-tag] - defaults: - run: - shell: powershell steps: - name: Checkout uses: actions/checkout@v2 - name: Set Artifacts Directory id: artifactsPath - run: echo "::set-output name=NUGET_ARTIFACTS::${{github.workspace}}\artifacts" + run: echo "::set-output name=NUGET_ARTIFACTS::${{github.workspace}}/artifacts" - name: Install .NET 6.0.x uses: actions/setup-dotnet@v1 with: dotnet-version: "6.0.x" + - name: Replace Project References + run: osu.Framework.Templates/replace-references.sh ${{needs.check-if-tag.outputs.version}} + - name: Pack (Template) run: dotnet pack -c Release osu.Framework.Templates /p:Configuration=Release /p:Version=${{needs.check-if-tag.outputs.version}} /p:GenerateDocumentationFile=true /p:NoDefaultExcludes=true -o ${{steps.artifactsPath.outputs.nuget_artifacts}} @@ -119,7 +119,7 @@ jobs: with: dotnet-version: "6.0.x" - - name: Restore .NET workloads + - name: Restore .NET Workloads run: dotnet workload restore - name: Pack (Android Framework) @@ -151,7 +151,7 @@ jobs: with: dotnet-version: "6.0.x" - - name: Restore .NET workloads + - name: Restore .NET Workloads run: dotnet workload restore - name: Pack (iOS Framework) diff --git a/osu.Framework.Templates/replace-references.sh b/osu.Framework.Templates/replace-references.sh new file mode 100755 index 000000000..8cfb10dd0 --- /dev/null +++ b/osu.Framework.Templates/replace-references.sh @@ -0,0 +1,18 @@ +game_projects=(./**/**/**/*.Game.csproj) +ios_projects=(./**/**/**/*.iOS.csproj) + +cd "$(dirname "$0")" + +for game_project in ${game_projects[@]} +do + dotnet remove ${game_project} reference ../osu.Framework/osu.Framework.csproj + dotnet add $game_project package ppy.osu.Framework -v $1 --no-restore +done + +for ios_project in ${ios_projects[@]} +do + dotnet remove $ios_project reference ../osu.Framework.iOS/osu.Framework.iOS.csproj + dotnet add $ios_project package ppy.osu.Framework.iOS -v $1 --no-restore +done + +sed -i '/osu.Framework.iOS.props/d' ./**/**/**/*.iOS.csproj