Skip to content

Merge branch 'dev' into 336-proper-handling-of-windows-service-manage… #79

Merge branch 'dev' into 336-proper-handling-of-windows-service-manage…

Merge branch 'dev' into 336-proper-handling-of-windows-service-manage… #79

name: Build exe installer for windows for prometheus-push only version
on:
push:
paths-ignore:
- 'docs_src/**'
- 'README.md'
- 'CITATION'
- 'book.toml'
- 'CONTRIBUTING.md'
tags: [ 'v*.*.*', 'dev*.*.*' ]
branches: [ '336-proper-handling-of-windows-service-management' ]
env:
WRD_VERSION: v0.0.3
WRD_BASE_URL: https://github.com/hubblo-org/windows-rapl-driver/releases/download
jobs:
build_exe_win1011:
name: Build exe installer for windows 10/11/server 2016/server 2019/server 2022
runs-on: "windows-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Innosoft
run: |
$url = "https://jrsoftware.org/download.php/is.exe"
$dest = "is.exe"
Invoke-WebRequest -Uri $url -OutFile $dest
ls
& "D:\a\scaphandre\scaphandre\$dest" /verysilent /suppressmsgbox
ls "C:\Program Files (x86)\Inno Setup 6\"
- name: Get windows-rapl-driver
shell: pwsh
run: |
$dest = "DriverLoader.exe"
$url = "${{ env.WRD_BASE_URL }}/${{ env.WRD_VERSION }}/DriverLoader.exe"
echo ($url -replace '"', "")
Invoke-WebRequest -Uri ($url -replace '"', "") -OutFile $dest
$dest = "ScaphandreDrv.cat"
$url = "${{ env.WRD_BASE_URL }}/${{ env.WRD_VERSION }}/ScaphandreDrv.cat"
Invoke-WebRequest -Uri ($url -replace '"', "") -OutFile $dest
$dest = "ScaphandreDrv.sys"
$url = "${{ env.WRD_BASE_URL }}/${{ env.WRD_VERSION }}/ScaphandreDrv.sys"
Invoke-WebRequest -Uri ($url -replace '"', "") -OutFile $dest
$dest = "ScaphandreDrv.inf"
$url = "${{ env.WRD_BASE_URL }}/${{ env.WRD_VERSION }}/ScaphandreDrv.inf"
Invoke-WebRequest -Uri ($url -replace '"', "") -OutFile $dest
$dest = "ScaphandreDrvTest.cer"
$url = "${{ env.WRD_BASE_URL }}/${{ env.WRD_VERSION }}/ScaphandreDrvTest.cer"
Invoke-WebRequest -Uri ($url -replace '"', "") -OutFile $dest
$dest = "devcon.exe"
$url = "${{ env.WRD_BASE_URL }}/${{ env.WRD_VERSION }}/devcon.exe"
Invoke-WebRequest -Uri ($url -replace '"', "") -OutFile $dest
$dest = "certmgr.exe"
$url = "${{ env.WRD_BASE_URL }}/${{ env.WRD_VERSION }}/certmgr.exe"
Invoke-WebRequest -Uri ($url -replace '"', "") -OutFile $dest
ls
- name: Install Rustup
uses: crazy-max/ghaction-chocolatey@v2
with:
args: install rustup.install --ignore-checksums
- name: Install Rust toolchain
run: |
rustup toolchain install stable-x86_64-pc-windows-msvc
- name: Build Scaphandre
run: |
cargo build --release --no-default-features --features "prometheuspush json"
- name: Build package
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" packaging/windows/installer.iss
- name: Upload artifact #Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
run: |
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
Install-Module -Confirm:$False -Name AWS.Tools.Installer
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Import-Module AWS.Tools.Installer
Install-AWSToolsModule AWS.Tools.EC2,AWS.Tools.S3 -CleanUp -Confirm:$False
Set-AWSCredential -AccessKey ${{ secrets.S3_ACCESS_KEY_ID }} -SecretKey ${{ secrets.S3_SECRET_ACCESS_KEY }} -StoreAs default
mv packaging/windows/Output/scaphandre_installer.exe scaphandre_${{ github.ref_name }}_installer.exe
$clientconfig=@{
SignatureVersion="s3v4"
ServiceUrl="https://s3.fr-par.scw.cloud"
}
Write-S3Object -EndpointUrl "https://s3.fr-par.scw.cloud" -Region "fr-par" -BucketName "scaphandre" -File scaphandre_${{ github.ref_name }}_installer.exe -key "x86_64/scaphandre_${{ github.ref_name }}_installer.exe" -PublicReadOnly -ClientConfig $clientconfig