147 lines (143 loc) · 6.01 KB
/
build-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
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
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
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.4
with:
fetch-depth: 0
- name: Checkout EdgarRenderer
uses: actions/checkout@v4.1.4
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.4
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: Set up Python ${{ inputs.python_version }}
uses: actions/setup-python@v5.1.0
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@v4.3.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@v4.3.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 }}
- name: "[Test] Test build"
run: |
pip install -r requirements-dev.txt
pytest -s --disable-warnings --all-frozen-builds --download-cache --offline --arelle="${{ env.BUILD_PATH }}\arelleCmdLine.exe" tests/integration_tests/scripts/test_scripts.py
- name: "[Test] Upload test artifacts"
if: always()
uses: actions/upload-artifact@v4.3.3
with:
name: 'windows test logs'
path: '.test/**/*.logfile.xml'