From d0a52cd4472817b46aca3cd2eaeaff8ac76715e0 Mon Sep 17 00:00:00 2001 From: Chris Marsh <84872334+ChrisMarsh82@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:58:15 +0100 Subject: [PATCH 1/3] Create release-build created new release builder for 64 bit only --- .github/workflows/release-build | 153 ++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 .github/workflows/release-build diff --git a/.github/workflows/release-build b/.github/workflows/release-build new file mode 100644 index 0000000000..c6f87d027b --- /dev/null +++ b/.github/workflows/release-build @@ -0,0 +1,153 @@ + +name: Create Installers + + + +on: + workflow_dispatch: + inputs: + major_version: + description: 'Major Version' + required: true + minor_version: + description: 'Minor Version' + required: true + revision_no: + description: 'Revision' + required: true + +jobs: + + build: + + # running on 2019 so that .NET version 4.5 and lower can be used + runs-on: windows-2019 + + # set variables + env: + Solution_Name: Instat.sln + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + + # check out r-instat + steps: + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.1.3 + + # set up and restore NuGet packages + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.1.1 + + - name: Restore NuGet + run: nuget restore $env:Solution_Name + + + # Restore the application to populate the obj folder with RuntimeIdentifiers + - name: Restore the application + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=Release + + # increment build number + - name: Generate build number + uses: einaregilsson/build-number@v3 + with: + token: ${{secrets.github_token}} + + #update version numbers in assembley + - name: set-version-assemblyinfo + uses: dannevesdantas/set-version-assemblyinfo@v.1.0.0 + with: + # Folder location to search for AssemblyInfo.cs/.vb files + path: instat\My Project\AssemblyInfo.vb + # optional, default is ${{ github.workspace }} + # Version number to set on [AssemblyVersion] and [AssemblyFileVersion] attributes of AssemblyInfo.cs/.vb files + version: "${{ inputs.major_version }}.${{ inputs.minor_version }}.${{ inputs.revision_no }}.${env:BUILD_NUMBER}" + + # Create the app package by building and packaging the Windows Application Packaging project + # 64bit + - name: Create the app package 64 bit + run: msbuild $env:Solution_Name /p:Configuration=Release /p:Platform=x64 /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} + env: + Appx_Bundle: Always + Appx_Package_Build_Mode: StoreUpload + Configuration: ${{ matrix.configuration }} + + # Build 64 bit installer without R + - name: Building the installer 64bit - No R + run: | + "%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_64bit.iss" + shell: cmd + + # Upload 64 bit installer without R + - name: Upload the 64 bit installer as an artifact + uses: actions/upload-artifact@v4 + if: ${{ github.event_name != 'pull_request' }} + with: + path: "Output/" + name: rinstat64NoR + + - name: Remove 64 bit without R installer + run: | + del "Output/*" + + # check out R-Instat Data + - name: Checkout Instat Data + uses: actions/checkout@v3 + with: + repository: ' africanmathsinitiative/R-Instat-Data' + fetch-depth: 0 + path: 'InstatData' + + # Create directory and copy over InstatData (64bit) + - name: Make Library directory 64 bit + run: | + MKDIR instat\bin\x64\Release\static\Library\ + + - name: Copy R-Instat Data 64 bit + run: | + ROBOCOPY InstatData\data\ instat\bin\x64\Release\static\Library\ /E + continue-on-error: true + + # check out R for R-Instat + - name: Checkout R for R-Instat + uses: actions/checkout@v3 + with: + repository: 'ChrisMarsh82/R-RInstat' + fetch-depth: 0 + path: 'R-RInstat' + + - name: Copy R 64 bit + run: | + ROBOCOPY R-RInstat\64Bit\ instat\bin\x64\Release\static\ /E + continue-on-error: true + + - name: Set R-tools + uses: r-windows/install-rtools@master + + - name: Install R packages (64 bit) + run: | + "instat\bin\x64\Release\static\R\bin\Rscript.exe" "instat\static\InstatObject\R\InstallPackages.R" + shell: cmd + + - name: Building the installer 64bit - With R + run: | + "%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_64bit.iss" + shell: cmd + + - name: Upload the 64 bit installer with R as an artifact + uses: actions/upload-artifact@v4 + if: ${{ github.event_name != 'pull_request' }} + with: + path: "Output/" + name: rinstat64WithR-innosetup + + - name: Remove 64 bit release files to free up space + run: | + Remove-Item "instat\bin\x64\Release\" -Recurse + From 8b3df7bf695a3541482709565a059bf44736d3e0 Mon Sep 17 00:00:00 2001 From: Chris Marsh <84872334+ChrisMarsh82@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:40:03 +0100 Subject: [PATCH 2/3] Update release-build --- .github/workflows/release-build | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-build b/.github/workflows/release-build index c6f87d027b..b84b29cf0e 100644 --- a/.github/workflows/release-build +++ b/.github/workflows/release-build @@ -15,6 +15,10 @@ on: revision_no: description: 'Revision' required: true + r-version: + description: 'Specify the R version to install' + required: true + default: '4.4.1' # Default version if the user does not specify jobs: @@ -113,7 +117,13 @@ jobs: run: | ROBOCOPY InstatData\data\ instat\bin\x64\Release\static\Library\ /E continue-on-error: true - + + # Install R + - name: Set up R + uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ inputs-version }} + # check out R for R-Instat - name: Checkout R for R-Instat uses: actions/checkout@v3 @@ -124,7 +134,7 @@ jobs: - name: Copy R 64 bit run: | - ROBOCOPY R-RInstat\64Bit\ instat\bin\x64\Release\static\ /E + ROBOCOPY R\ instat\bin\x64\Release\static\ /E continue-on-error: true - name: Set R-tools From 2f4f3f26827190d1a1541cd52cd1810048e6d73d Mon Sep 17 00:00:00 2001 From: Chris Marsh <84872334+ChrisMarsh82@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:58:00 +0100 Subject: [PATCH 3/3] Update release-build --- .github/workflows/release-build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-build b/.github/workflows/release-build index b84b29cf0e..dde45f0d61 100644 --- a/.github/workflows/release-build +++ b/.github/workflows/release-build @@ -132,10 +132,15 @@ jobs: fetch-depth: 0 path: 'R-RInstat' + - name: Update Rprofile.site + run: | + ROBOCOPY R-Instat\Installer\Rprofile.site R\etc\ /E + continue-on-error: true + - name: Copy R 64 bit run: | ROBOCOPY R\ instat\bin\x64\Release\static\ /E - continue-on-error: true + continue-on-error: true - name: Set R-tools uses: r-windows/install-rtools@master