Package for Windows #417
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package for Windows | |
on: | |
workflow_dispatch: | |
inputs: | |
git-ref: | |
description: Branch of gem/oq-builders repository | |
default: master | |
required: true | |
path: | |
description: Path to upload packages | |
default: /oq-engine/ | |
required: true | |
oq-ref: | |
description: Branch of Openquake Engine | |
default: master | |
required: true | |
oq-rel: | |
description: Build Number of Openquake Engine | |
default: 1 | |
required: false | |
# push: | |
# branches: | |
# - | |
schedule: | |
- cron: "0 5 * * *" | |
jobs: | |
Build_Installer: | |
runs-on: ubuntu-latest | |
env: | |
GEM_SET_BRANCH: ${{ github.event.inputs.oq-ref }} | |
GEM_SET_BRANCH_TOOLS: ${{ github.event.inputs.oq-ref }} | |
GEM_SET_RELEASE: ${{ github.event.inputs.oq-rel }} | |
GIT_BRANCH: ${{ github.ref }} | |
GIT_COMMIT_SHA: ${{ github.sha }} | |
steps: | |
- name: Clone Repository (Latest) | |
uses: actions/checkout@v3 | |
if: github.event.inputs.git-ref == '' | |
- name: Clone Repository (Custom Ref) | |
uses: actions/checkout@v3 | |
if: github.event.inputs.git-ref != '' | |
with: | |
ref: ${{ github.event.inputs.git-ref }} | |
- name: Docker build of the container and create installer | |
run: | | |
echo "Check variable for build packages" | |
echo "GEM_SET_BRANCH: ${GEM_SET_BRANCH}" | |
echo "GEM_SET_BRANCH_TOOLS: ${GEM_SET_BRANCH_TOOLS}" | |
echo "GEM_SET_RELEASE: ${GEM_SET_RELEASE}" | |
sleep 2 | |
bash -x ci/windows_package.sh | |
# | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Installer | |
path: /home/runner/work/oq-builders/oq-builders/out | |
retention-days: 5 | |
Test_OQ: | |
needs: Build_Installer | |
runs-on: windows-latest | |
steps: | |
- name: Download Windows Installer from build job | |
uses: actions/download-artifact@v3 | |
with: | |
name: Installer | |
- name: Execute the Installer | |
run: | | |
$Install = Get-ChildItem -Filter *.exe | |
Start-Process -FilePath $Install.Fullname -ArgumentList "/S" -Wait | |
cd "C:\Program Files\OpenQuake Engine\" | |
$env:PATH="C:\Program Files\OpenQuake Engine\python3\Scripts" | |
Write-Host ${env:PATH} | |
pwd | |
- name: Run oq | |
run: | | |
set mypath="C:\Program Files\OpenQuake Engine" | |
set PATH=%mypath%\python;%mypath%\python3\Scripts;%PATH% | |
cd "C:\Program Files\Openquake Engine" | |
dir | |
oq --version | |
oq.exe engine --run "https://downloads.openquake.org/pkgs/test_event_based_risk_inputs_bc.zip" | |
shell: cmd | |
- name: Run oq webui console and curl for the standalone tools | |
run: | | |
Start-Job -ScriptBlock{& 'C:\Program Files\OpenQuake Engine\python3\Scripts\oq.exe' webui start 127.0.0.1:8800 -s} | |
ping 127.0.0.1 -n 6 > null | |
Get-Job | |
netstat -o -n -a | findstr 8800 | |
ping 127.0.0.1 -n 6 > null | |
curl.exe -X HEAD -I http://127.0.0.1:8800/ipt/ | |
ping 127.0.0.1 -n 6 > null | |
curl.exe -X HEAD -I http://127.0.0.1:8800/taxonomy/ | |
ping 127.0.0.1 -n 6 > null | |
curl.exe -X HEAD -I http://127.0.0.1:8800/taxtweb/ | |
Upload_Installer: | |
needs: Test_OQ | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download Windows Installer from build job | |
uses: actions/download-artifact@v3 | |
with: | |
name: Installer | |
- name: rsync to downloads.openquake.org | |
shell: bash | |
env: | |
DOWNLOAD_SSH: ${{ secrets.DOWNLOAD_ARTIFACTS }} | |
folder: ${{ github.event.inputs.path }} | |
run: | | |
gpg --quiet --batch --yes --decrypt --passphrase="$DOWNLOAD_SSH" --output ./.deploy_rsa ./.oq_builders.enc | |
chmod 600 ./.deploy_rsa | |
eval $(ssh-agent -s) && ssh-add ./.deploy_rsa | |
# print value of folder | |
echo "Folder to upload packages: ${folder}" | |
if test -z "$folder" | |
then | |
echo "\$folder is empty" | |
folder=oq-engine/nightly/ | |
echo $folder | |
else | |
echo "\$folder is NOT empty" | |
fi | |
#rsync -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 332' -ax OpenQuake_Engine* [email protected]:/mnt/box/openquake/downloads/pkgs/windows/oq-engine/nightly/ | |
rsync -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 332' -ax OpenQuake_Engine* [email protected]:/mnt/box/openquake/downloads/pkgs/windows/${folder} |