Skip to content

Version 12.3.58

Version 12.3.58 #58

name: Build Nightly 12.3
run-name: Version 12.3.${{ github.run_number }}
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
permissions:
contents: read
packages: read
jobs:
get-latest-commit-timespan:
runs-on: ubuntu-latest
outputs:
LATEST_COMMIT_TIMESPAN: ${{ steps.get-latest-commit-timespan.outputs.LATEST_COMMIT_TIMESPAN}}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get the previous commit timespan
id: get-latest-commit-timespan
shell: bash
run: |
commit=$(git log origin/develop -1 --format="%at")
echo $commit
now=$(date +%s)
echo $now
timespan=$[now - commit]
echo "Timespan: ${timespan}"
echo "LATEST_COMMIT_TIMESPAN=${timespan}" >> $GITHUB_ENV
echo "LATEST_COMMIT_TIMESPAN=${timespan}" >> $GITHUB_OUTPUT
build-nightly:
needs: get-latest-commit-timespan
# the build-nightly job should be run in 2 cases:
# - either the workflow was triggered manually (on 'workflow_dispatch')
# - or the workflow was triggered on schedule and last repository commit is not older than 24h (=86400 sec)
if: needs.get-latest-commit-timespan.outputs.LATEST_COMMIT_TIMESPAN < 86400 || github.event_name == 'workflow_dispatch'
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Restore dependencies
run: |
nuget sources add -username Open-Systems-Pharmacology -password ${{ secrets.GITHUB_TOKEN }} -name OSP-GitHub-Packages -source "https://nuget.pkg.github.com/Open-Systems-Pharmacology/index.json"
nuget restore
- name: define env variables
run: |
echo "APP_VERSION=12.3.${{ github.run_number }}" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Build
run: |
dotnet build InstallationValidator.sln /p:Version=${{env.APP_VERSION}}
- name: Test
run: dotnet test InstallationValidator.sln --filter “TestCategory!=Reporting” --no-build -v normal --logger:"html;LogFileName=../testLog_Windows.html"
- name: Sign InstallationValidator.exe with CodeSignTool
uses: Open-Systems-Pharmacology/Workflows/.github/actions/codesigner-SSL@main
env:
ES_USERNAME: ${{ secrets.ES_USERNAME }}
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_CREDENTIAL_ID: ${{ secrets.ES_CREDENTIAL_ID }}
ES_TOTP_SECRET: ${{ secrets.ES_TOTP_SECRET }}
with:
file_path: ./src/InstallationValidator/bin/Debug/net472/InstallationValidator.exe
- name: Sign SimulationOutputComparer.exe with CodeSignTool
uses: Open-Systems-Pharmacology/Workflows/.github/actions/codesigner-SSL@main
env:
ES_USERNAME: ${{ secrets.ES_USERNAME }}
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_CREDENTIAL_ID: ${{ secrets.ES_CREDENTIAL_ID }}
ES_TOTP_SECRET: ${{ secrets.ES_TOTP_SECRET }}
with:
file_path: ./src/SimulationOutputComparer/bin/Debug/net472/SimulationOutputComparer.exe
- name: Create Setup
run: |
rake "create_setup[${{env.APP_VERSION}}, Debug]"
- name: Sign InstallationValidator setup with CodeSignTool
uses: Open-Systems-Pharmacology/Workflows/.github/actions/codesigner-SSL@main
env:
ES_USERNAME: ${{ secrets.ES_USERNAME }}
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_CREDENTIAL_ID: ${{ secrets.ES_CREDENTIAL_ID }}
ES_TOTP_SECRET: ${{ secrets.ES_TOTP_SECRET }}
with:
file_path: ./setup/deploy/InstallationValidator.${{ env.APP_VERSION }}.msi
- name: Push test log as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: testLog_Windows
path: ./testLog*.html
- name: Push nightly installer as artifact
uses: actions/upload-artifact@v4
with:
name: Installation Validator Installer ${{env.APP_VERSION}}
path: setup\deploy\*.msi
cleanup-job:
needs: build-nightly
# run only if the build-nightly job was skipped
if: always() && needs.build-nightly.result == 'skipped'
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Cancel workflow run
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"