wait for the process to start before closing handles #208
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: 'Build' | |
env: | |
VERSION: 3.7.1 | |
BUILD_TYPE: Release | |
ARCH: x64 | |
VCPKG_CONFIG: Release | |
VCPKG_HASH: 8e9dc3c690558456a667ede3555e01783c3fab9c | |
DOC_INSTANCE: wrs/bt | |
DOC_ARTIFACT: webHelpBT2-all.zip | |
DOC_ALGOLIA_ARTIFACT: algolia-indexes-BT.zip | |
DOC_DOCKER_VERSION: 232.10275 | |
on: [push, workflow_dispatch] | |
# Gives the workflow permissions to clone the repo and create a page deployment | |
permissions: | |
id-token: write | |
pages: write | |
jobs: | |
build-win: | |
runs-on: windows-latest | |
name: 'Windows Build' | |
env: | |
VCPKG_DEFAULT_VCPKG_TRIPLET: x64-windows-static | |
VCPKG_TRIPLET: x64-windows-static | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: pre-build patch script | |
run: .\pre-build.ps1 | |
shell: pwsh | |
- uses: friendlyanon/setup-vcpkg@v1 | |
# seems like the absense of commit hash expects vcpkg submodule, i don't want that | |
with: | |
committish: ${{ env.VCPKG_HASH }} | |
# set to false to clear any cache in case of build errors | |
cache: false | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: ⚙️ configure | |
run: > | |
cmake -B build -S . | |
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
-D "CMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" | |
-D "VCPKG_TARGET_TRIPLET=${{ env.VCPKG_TRIPLET }}" | |
working-directory: . | |
- name: 🏭 build | |
run: cmake --build build --config ${{ env.VCPKG_CONFIG }} | |
working-directory: . | |
- name: debug | |
run: ls -R | |
working-directory: build/test | |
- name: 🧪 unit tests | |
run: .\test.exe | |
working-directory: build/test/Release | |
- name: 📦 pack | |
run: cpack -C ${{ env.BUILD_TYPE }} | |
working-directory: build | |
# - name: debug | |
# run: ls -R | |
# working-directory: build | |
- name: Create artifacts directory | |
run: mkdir atf | |
# put the following inside "atf" subdir: | |
# 1. msi installer, renamed after version number | |
# 2. zipped .exe | |
# 3. version.txt containing version number | |
- name: prep artifacts | |
run: | | |
cp build/bt.msi atf/${{ env.MSI_FILE_NAME }} | |
Compress-Archive -Path build/bt/Release/bt.exe -DestinationPath atf/${{ env.ZIP_FILE_NAME }} -CompressionLevel Optimal | |
Compress-Archive -Path build/bt/Release/bt.pdb -DestinationPath atf/${{ env.PDB_FILE_NAME }} -CompressionLevel Optimal | |
"${{ env.VERSION }}" | Out-File atf/version.txt -NoNewline | |
(Get-FileHash -Algorithm SHA256 -Path atf/${{ env.ZIP_FILE_NAME }}).Hash | Out-File atf/${{ env.ZIP_FILE_NAME }}.sha256.txt | |
(Get-FileHash -Algorithm SHA256 -Path atf/${{ env.MSI_FILE_NAME }}).Hash | Out-File atf/${{ env.MSI_FILE_NAME }}.sha256.txt | |
cp docs/release-notes.md atf/ | |
cp docs/instructions.md atf/ | |
env: | |
ZIP_FILE_NAME: bt-${{ env.VERSION }}.zip | |
PDB_FILE_NAME: pdb-${{ env.VERSION }}.zip | |
MSI_FILE_NAME: bt-${{ env.VERSION }}.msi | |
# python.exe exit code for vt_scan.py is -1073741819 - this is a bug in python, it's not a real error. | |
- name: VT Scan | |
run: | | |
pip install -r scripts/requirements.txt | |
python scripts/vt_scan.py --files atf/${{ env.ZIP_FILE_NAME }} atf/${{ env.MSI_FILE_NAME }} --md-output atf/vt.md | |
$LASTEXITCODE = 0 | |
env: | |
ZIP_FILE_NAME: bt-${{ env.VERSION }}.zip | |
MSI_FILE_NAME: bt-${{ env.VERSION }}.msi | |
VT_API_KEY: ${{ secrets.VT_API_KEY }} | |
- uses: actions/upload-artifact@v3 | |
name: collect binaries | |
with: | |
name: bin | |
path: atf/* | |
# build-linux: | |
# runs-on: ubuntu-latest | |
# name: 'Linux Build' | |
# env: | |
# VCPKG_DEFAULT_VCPKG_TRIPLET: x64-linux | |
# VCPKG_TRIPLET: x64-linux | |
# steps: | |
# - uses: actions/checkout@v3 | |
# with: | |
# submodules: true | |
# - uses: friendlyanon/setup-vcpkg@v1 | |
# with: | |
# committish: ${{ env.VCPKG_HASH }} | |
# cache: true | |
# - name: ⚙️ configure | |
# run: > | |
# cmake -B build -S . | |
# -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
# -D "CMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" | |
# -D "VCPKG_TARGET_TRIPLET=${{ env.VCPKG_TRIPLET }}" | |
# working-directory: . | |
# - name: 🏭 build | |
# run: cmake --build build --config ${{ env.VCPKG_CONFIG }} | |
# working-directory: . | |
# - name: debug | |
# run: ls -R | |
# working-directory: build | |
# - name: 🧪 unit tests | |
# run: ./test | |
# working-directory: build/test | |
wrs-build: | |
runs-on: ubuntu-latest | |
name: 'Build Docs' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build docs | |
uses: JetBrains/writerside-github-action@v4 | |
with: | |
instance: ${{ env.DOC_INSTANCE }} | |
artifact: ${{ env.DOC_INSTANCE }} | |
docker-version: ${{ env.DOC_DOCKER_VERSION }} | |
- name: Upload documentation | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: artifacts/*.zip | |
retention-days: 1 | |
wrs-deploy: | |
needs: wrs-build | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
name: 'Deploy Docs to GitHub Pages' | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
- name: Unzip artifact | |
run: unzip -O UTF-8 -qq ${{ env.DOC_ARTIFACT }} -d dir | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: dir | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |