From 567d61a8ea8762a8a681974a78907a3eda43802a Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:44:08 +0100 Subject: [PATCH] Add make script and update build job --- .github/workflows/build_win.yml | 51 ++++++++++++++++++++++++++++++++- .gitignore | 1 + setup/windows/make.ps1 | 11 +++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 setup/windows/make.ps1 diff --git a/.github/workflows/build_win.yml b/.github/workflows/build_win.yml index 391a13c5..053e5c38 100644 --- a/.github/workflows/build_win.yml +++ b/.github/workflows/build_win.yml @@ -6,8 +6,51 @@ jobs: buildAssets: uses: ./.github/workflows/build_assets.yml + buildLauncherWin64: + runs-on: windows-latest + steps: + - name: Checkout Source + uses: actions/checkout@v4 + + - name: Build Launcher + id: build + run: | + Set-Location setup\windows + .\make.ps1 + + - name: Upload Unsigned Artifacts + id: upload-unsigned-artifact + uses: actions/upload-artifact@v4 + with: + name: launcher + path: novelWriter.exe + if-no-files-found: error + retention-days: 14 + + - name: Submit Signing Request + uses: signpath/github-action-submit-signing-request@v1 + with: + api-token: "${{ secrets.SIGNPATH_API_TOKEN }}" + organization-id: "0471e52c-66fa-4e9a-bfb9-36167095ca3f" + project-slug: "novelWriter" + signing-policy-slug: "release-signing" + artifact-configuration-slug: "launcher" + github-artifact-id: "${{ steps.upload-unsigned-artifact.outputs.artifact-id }}" + wait-for-completion: true + output-artifact-directory: "." + + - name: Upload Signed Artifacts + uses: actions/upload-artifact@v4 + with: + name: launcher-signed + path: novelWriter.exe + if-no-files-found: error + retention-days: 14 + buildWin64: - needs: buildAssets + needs: + - buildAssets + - buildLauncherWin64 runs-on: windows-latest steps: - name: Python Setup @@ -25,6 +68,12 @@ jobs: name: nw-assets path: novelwriter/assets + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + name: launcher-signed + path: setup/windows + - name: Build Setup Installer id: build run: | diff --git a/.gitignore b/.gitignore index 90e51a5d..fd69c45f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ setup.iss /novelwriter.desktop /novelWriter.pyw /setup/macos/Info.plist +/setup/windows/build .venv # Translations diff --git a/setup/windows/make.ps1 b/setup/windows/make.ps1 new file mode 100644 index 00000000..2056ce63 --- /dev/null +++ b/setup/windows/make.ps1 @@ -0,0 +1,11 @@ +if (Test-Path .\build) { + Remove-Item .\build -Recurse +} +New-Item -Path . -Name build -ItemType Directory +Set-Location .\build + +cmake -S .. -B . +cmake --build . --config Release + +Set-Location .. +Copy-Item .\build\Release\novelWriter.exe . -Force