Build Windows #92
Workflow file for this run
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 Windows | |
on: | |
workflow_call: | |
inputs: | |
edgar_renderer_ref: | |
description: 'Arelle/EdgarRenderer branch, tag or SHA to checkout (blank for default)' | |
required: false | |
type: string | |
ixbrl_viewer_ref: | |
description: 'Workiva/ixbrl-viewer branch, tag or SHA to checkout (blank for default)' | |
required: false | |
type: string | |
node_version: | |
default: '20' | |
description: 'Node.js version to use' | |
required: false | |
type: string | |
python_version: | |
default: '3.11' | |
description: 'Python version to use' | |
required: false | |
type: string | |
xule_ref: | |
description: 'xbrlus/xule branch, tag or SHA to checkout (blank for default)' | |
required: false | |
type: string | |
outputs: | |
exe_artifact_versioned_name: | |
description: 'The file name of the installer including the version, e.g. "arelle-win-1.0.0.exe".' | |
value: ${{ jobs.build-windows.outputs.exe_artifact_versioned_name }} | |
zip_artifact_versioned_name: | |
description: 'The file name of the ZIP build including the version, e.g. "arelle-win-1.0.0.zip".' | |
value: ${{ jobs.build-windows.outputs.zip_artifact_versioned_name }} | |
exe_uploaded_artifact_name: | |
description: 'The name of the GitHub Actions artifact for the installer.' | |
value: ${{ jobs.build-windows.outputs.exe_uploaded_artifact_name }} | |
zip_uploaded_artifact_name: | |
description: 'The name of the GitHub Actions artifact for the ZIP build.' | |
value: ${{ jobs.build-windows.outputs.zip_uploaded_artifact_name }} | |
workflow_dispatch: | |
inputs: | |
edgar_renderer_ref: | |
description: 'Arelle/EdgarRenderer branch, tag or SHA to checkout (blank for default)' | |
required: false | |
type: string | |
ixbrl_viewer_ref: | |
description: 'Workiva/ixbrl-viewer branch, tag or SHA to checkout (blank for default)' | |
required: false | |
type: string | |
node_version: | |
default: '20' | |
description: 'Node.js version to use' | |
required: true | |
type: string | |
python_version: | |
default: '3.11' | |
description: 'Python version to use' | |
required: true | |
type: string | |
xule_ref: | |
description: 'xbrlus/xule branch, tag or SHA to checkout (blank for default)' | |
required: false | |
type: string | |
permissions: {} | |
jobs: | |
build-windows: | |
env: | |
BUILD_PATH: build\exe.win-amd64-${{ inputs.python_version }} | |
runs-on: windows-2022 | |
outputs: | |
exe_artifact_versioned_name: ${{ steps.define-artifact-names.outputs.exe_artifact_versioned_name }} | |
zip_artifact_versioned_name: ${{ steps.define-artifact-names.outputs.zip_artifact_versioned_name }} | |
exe_uploaded_artifact_name: ${{ steps.define-artifact-names.outputs.exe_uploaded_artifact_name }} | |
zip_uploaded_artifact_name: ${{ steps.define-artifact-names.outputs.zip_uploaded_artifact_name }} | |
steps: | |
- name: Checkout arelle | |
uses: actions/checkout@v4.1.1 | |
with: | |
fetch-depth: 0 | |
- name: Checkout EdgarRenderer | |
uses: actions/checkout@v4.1.1 | |
with: | |
repository: Arelle/EdgarRenderer | |
path: arelle/plugin/EdgarRenderer | |
ref: ${{ inputs.edgar_renderer_ref }} | |
- shell: cmd | |
run: rmdir /s /q arelle\plugin\EdgarRenderer\.git | |
- name: Checkout xule | |
uses: actions/checkout@v4.1.1 | |
with: | |
repository: xbrlus/xule | |
path: xule | |
ref: ${{ inputs.xule_ref }} | |
- name: Move plugins | |
run: | | |
mv xule\plugin\validate\* arelle\plugin\validate\ | |
rmdir xule\plugin\validate | |
mv xule\plugin\* arelle\plugin\ | |
- shell: cmd | |
run: rmdir /s /q xule | |
- name: Checkout ixbrl-viewer | |
uses: actions/checkout@v4.1.1 | |
with: | |
fetch-depth: 0 | |
repository: Workiva/ixbrl-viewer | |
path: ixbrl-viewer | |
ref: ${{ inputs.ixbrl_viewer_ref }} | |
- name: Set up Node JS | |
uses: actions/setup-node@v4.0.0 | |
with: | |
node-version: ${{ inputs.node_version }} | |
- name: Build ixbrl-viewer | |
working-directory: ixbrl-viewer | |
run: | | |
npm install | |
make prod | |
- shell: cmd | |
run: move ixbrl-viewer\iXBRLViewerPlugin arelle\plugin\iXBRLViewerPlugin && rmdir /s /q ixbrl-viewer | |
- name: Set up Python ${{ inputs.python_version }} | |
uses: actions/setup-python@v4.7.1 | |
with: | |
cache: 'pip' | |
check-latest: true | |
python-version: ${{ inputs.python_version }} | |
- name: Install NSIS | |
run: choco install nsis | |
- name: Install requirements | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install -r requirements-build.txt | |
- name: Capture build version | |
run: echo ("BUILD_VERSION=" + (python -W ignore distro.py --version)) >> $env:GITHUB_ENV | |
- name: Define artifact names | |
id: define-artifact-names | |
run: | | |
echo "exe_artifact_versioned_name=arelle-win-${{ env.BUILD_VERSION }}.exe" >> $env:GITHUB_OUTPUT | |
echo "zip_artifact_versioned_name=arelle-win-${{ env.BUILD_VERSION }}.zip" >> $env:GITHUB_OUTPUT | |
echo "exe_build_artifact_path=dist\arelle-win-${{ env.BUILD_VERSION }}.exe" >> $env:GITHUB_OUTPUT | |
echo "zip_build_artifact_path=dist\arelle-win-${{ env.BUILD_VERSION }}.zip" >> $env:GITHUB_OUTPUT | |
echo "exe_uploaded_artifact_name=windows installer distribution" >> $env:GITHUB_OUTPUT | |
echo "zip_uploaded_artifact_name=windows zip distribution" >> $env:GITHUB_OUTPUT | |
- name: Build exe | |
run: ./scripts/buildWinDist.bat | |
- name: Copy Tktable2.11 | |
run: xcopy libs\win64\Tktable2.11 ${{ env.BUILD_PATH }}\lib /y | |
- name: Delete .git | |
shell: cmd | |
run: if exist "${{ env.BUILD_PATH }}\.git" rmdir /s /q ${{ env.BUILD_PATH }}\.git | |
- name: Make installer | |
run: makensis installWin64.nsi | |
- name: Version installer | |
run: mv dist\arelle-win-x64.exe ${{ steps.define-artifact-names.outputs.exe_build_artifact_path }} | |
- name: Zip distribution | |
working-directory: ${{ env.BUILD_PATH }} | |
run: 7z a -tzip ..\..\${{ steps.define-artifact-names.outputs.zip_build_artifact_path }} * | |
- name: Upload installer artifact | |
id: upload-installer-artifact | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: ${{ steps.define-artifact-names.outputs.exe_uploaded_artifact_name }} | |
if-no-files-found: error | |
path: ${{ steps.define-artifact-names.outputs.exe_build_artifact_path }} | |
- name: Upload zip artifact | |
id: upload-zip-artifact | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: ${{ steps.define-artifact-names.outputs.zip_uploaded_artifact_name }} | |
if-no-files-found: error | |
path: ${{ steps.define-artifact-names.outputs.zip_build_artifact_path }} |