diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 611c44a8823..c8a38d39aaf 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -10,25 +10,61 @@ on: - 1.10.x jobs: - compile: - name: Compile + compile-dotnet: + name: Compile .NET solution defaults: run: shell: pwsh runs-on: windows-latest - steps: - name: Clone repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@v4.1.1 - name: Restore NuGet packages run: nuget restore src/Orchard.sln - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 + uses: microsoft/setup-msbuild@v2 - name: Compile run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError - name: Test run: msbuild Orchard.proj /m /v:minimal /t:Test + + compile-node: + name: Compile client-side assets + defaults: + run: + shell: pwsh + runs-on: windows-latest + steps: + - name: Clone repository + uses: actions/checkout@v4.1.1 + + - name: Setup NodeJS + uses: actions/setup-node@v4.0.2 + with: + node-version: '7' + + - name: Setup NPM packages + working-directory: ./src + run: | + npm install --loglevel warn + + # Install gulp globally to be able to run the rebuild task, using the same version as in the project. + $gulpVersion = (Get-Content Package.json -Raw | ConvertFrom-Json).devDependencies.gulp + Start-Process npm -NoNewWindow -Wait -ArgumentList "install gulp@$gulpVersion -g --loglevel warn" + + - name: Rebuild client-side assets + working-directory: ./src + run: | + gulp rebuild + + git add . # To make line ending changes "disappear". + $gitStatus = (git status --porcelain) + if ($gitStatus) + { + throw ("Client-side assets are not up-to-date. Please run 'gulp rebuild' and commit the changes.`n" + + [System.String]::Join([System.Environment]::NewLine, $gitStatus)) + } diff --git a/src/Orchard.Web/Modules/Orchard.Alias/Views/Admin/IndexManaged.cshtml b/src/Orchard.Web/Modules/Orchard.Alias/Views/Admin/IndexManaged.cshtml index 7bcee7ab456..3b4fbceebef 100644 --- a/src/Orchard.Web/Modules/Orchard.Alias/Views/Admin/IndexManaged.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Alias/Views/Admin/IndexManaged.cshtml @@ -6,8 +6,6 @@ @using Orchard.Utility.Extensions @{ - var urlPrefix = WorkContext.Resolve().RequestUrlPrefix; - Layout.Title = T("Manage Aliases").Text; var aliasService = WorkContext.Resolve(); AdminIndexOptions options = Model.Options; @@ -59,10 +57,10 @@ - @Html.Link(alias.Path == String.Empty ? "/" : alias.Path, Href("~/" + urlPrefix + alias.Path)) + @Html.Link(alias.Path == String.Empty ? "/" : alias.Path, Href("~/" + alias.Path)) - @Html.Link(url, Href("~/" + urlPrefix + "/" + url)) + @Html.Link(url, Href("~/" + url)) } diff --git a/src/Orchard.Web/Modules/Orchard.Alias/Views/Admin/IndexUnmanaged.cshtml b/src/Orchard.Web/Modules/Orchard.Alias/Views/Admin/IndexUnmanaged.cshtml index c3c64de1b84..8cfd45f1772 100644 --- a/src/Orchard.Web/Modules/Orchard.Alias/Views/Admin/IndexUnmanaged.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Alias/Views/Admin/IndexUnmanaged.cshtml @@ -6,8 +6,6 @@ @using Orchard.Utility.Extensions @{ - var urlPrefix = WorkContext.Resolve().RequestUrlPrefix; - Layout.Title = T("Manage Aliases").Text; var aliasService = WorkContext.Resolve(); AdminIndexOptions options = Model.Options; @@ -73,10 +71,10 @@ - @Html.Link(alias.Path == String.Empty ? "/" : alias.Path, Href("~/" + urlPrefix + alias.Path)) + @Html.Link(alias.Path == String.Empty ? "/" : alias.Path, Href("~/" + alias.Path)) - @Html.Link(url, Href("~/" + urlPrefix + "/" + url)) + @Html.Link(url, Href("~/" + url))