From 8851f622a38d219005bbc389ab590c1e449f4ee8 Mon Sep 17 00:00:00 2001 From: Benedek Farkas Date: Mon, 29 Sep 2025 20:53:30 +0200 Subject: [PATCH] Adding release package workflow (#8846) (cherry picked from commit 4268b28d95fdcc778ead9e0ba4b457ac1b3b6987) --- .../build-crowdin-translation-packages.yml | 27 +++++++++ .github/workflows/compile.yml | 8 +-- .github/workflows/release-package.yml | 39 ++++++++++++ .github/workflows/specflow.yml | 59 +++++++++++++++++++ 4 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build-crowdin-translation-packages.yml create mode 100644 .github/workflows/release-package.yml create mode 100644 .github/workflows/specflow.yml diff --git a/.github/workflows/build-crowdin-translation-packages.yml b/.github/workflows/build-crowdin-translation-packages.yml new file mode 100644 index 000000000..de8f128e0 --- /dev/null +++ b/.github/workflows/build-crowdin-translation-packages.yml @@ -0,0 +1,27 @@ +name: Build Crowdin Translation Packages + +on: + workflow_dispatch: + schedule: + - cron: '0 6 * * *' + +jobs: + build-crowdin-translation-packages: + runs-on: ubuntu-24.04 + + steps: + - name: Orchard CMS + uses: andrii-bodnar/crowdin-request-action@ee7a2af9564d8934b5b4a8427185aaaffee0165e # v0.3.0 + with: + route: POST /projects/{projectId}/translations/builds + projectId: 46524 + env: + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} + + - name: Orchard CMS Gallery + uses: andrii-bodnar/crowdin-request-action@ee7a2af9564d8934b5b4a8427185aaaffee0165e # v0.3.0 + with: + route: POST /projects/{projectId}/translations/builds + projectId: 63766 + env: + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index d0636920c..b15eaa0c6 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -17,13 +17,13 @@ jobs: runs-on: windows-2025 steps: - name: Clone Repository - uses: actions/checkout@v4.1.1 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Restore NuGet Packages run: nuget restore src/Orchard.sln - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 - name: Compile run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:TreatWarningsAsErrors=true -WarnAsError /p:MvcBuildViews=true @@ -69,10 +69,10 @@ jobs: runs-on: windows-2025 steps: - name: Clone Repository - uses: actions/checkout@v4.1.1 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Setup NodeJS - uses: actions/setup-node@v4.0.2 + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: node-version: 7 diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml new file mode 100644 index 000000000..8432969db --- /dev/null +++ b/.github/workflows/release-package.yml @@ -0,0 +1,39 @@ +name: Release Package +# Builds the release package and uploads it as an artifact. + +on: + workflow_dispatch: + +jobs: + release-package: + name: Release Package + runs-on: Windows-2025 + defaults: + run: + shell: cmd + steps: + - name: Clone Repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - name: Restore NuGet Packages + run: nuget restore src/Orchard.sln + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 + + - name: Build Precompiled Application + run: msbuild Orchard.proj /m /v:minimal /t:Precompiled + + - name: Generate Release Package Name + id: package-name + shell: pwsh + run: | + $packageName = "Orchard-$('${{ github.ref_name }}'.Replace('/', '_'))-${{ github.sha }}" + "package-name=$packageName" >> $Env:GITHUB_OUTPUT + + - name: Upload Release Package + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: ${{ steps.package-name.outputs.package-name }} + path: .\build\Precompiled + if-no-files-found: error diff --git a/.github/workflows/specflow.yml b/.github/workflows/specflow.yml new file mode 100644 index 000000000..c36a2e5e4 --- /dev/null +++ b/.github/workflows/specflow.yml @@ -0,0 +1,59 @@ +name: SpecFlow Tests +# Compiles the solution and runs unit tests, as well the SpecFlow tests on the main development branches. + +on: + workflow_dispatch: + push: + branches: + - 1.10.x + - dev + schedule: + - cron: '0 0 * * 1' # Every Monday midnight. + +jobs: + define-matrix: + name: Define Strategy Matrix + runs-on: ubuntu-24.04 + outputs: + branches: ${{ steps.branches.outputs.branches }} + steps: + - name: Define Branches + id: branches + run: | + if [ "${{ github.event_name }}" = "schedule" ]; then + echo 'branches=["1.10.x", "dev"]' >> "$GITHUB_OUTPUT" + else + echo 'branches=["${{ github.ref_name }}"]' >> "$GITHUB_OUTPUT" + fi + + compile: + name: SpecFlow Tests + needs: define-matrix + runs-on: windows-2025 + strategy: + matrix: + branch: ${{ fromJSON(needs.define-matrix.outputs.branches) }} + fail-fast: false + defaults: + run: + shell: cmd + steps: + - name: Clone Repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + ref: ${{ matrix.branch }} + + - name: Restore NuGet Packages + run: nuget restore src/Orchard.sln + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 + + - 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 + + - name: Spec + run: msbuild Orchard.proj /m /v:minimal /t:Spec