Fixing errors in windows and linux scripts. #1
This file contains hidden or 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
| # .github/workflows/build-windows.yml | ||
| name: Reusable Windows Build | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| version_string: | ||
| required: true | ||
| type: string | ||
| outputs: | ||
| artifact_name: | ||
| description: "The name of the output artifact" | ||
| value: ${{ jobs.build.outputs.artifact_name }} | ||
| jobs: | ||
| build: | ||
| runs-on: windows-latest | ||
| outputs: | ||
| artifact_name: ${{ steps.upload.outputs.artifact-name }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: { python-version: '3.10' } | ||
| - name: Install Dependencies | ||
| run: pip install pyinstaller Pillow numpy scipy platformdirs tqdm | ||
| - name: Update Version in Files | ||
| shell: bash | ||
| run: find . -type f -name "*.py" -exec sed -i "s/<unreleased>/${{ inputs.version_string }}/g" {} + | ||
| - name: Build Windows Binary | ||
| # This replaces the old 'run: make win' line | ||
| shell: cmd | ||
| run: | | ||
| py -m PyInstaller --noconsole --onedir --clean ^ | ||
| --add-data "msxtileexport.py;." ^ | ||
| --add-data "msxtilemagic.py;." ^ | ||
| --add-data "tilerandomizer.py;." ^ | ||
| --add-data "superfilerandomizer.py;." ^ | ||
| msxtileforge.py | ||
| copy README.md LICENSE dist\msxtileforge\ | ||
| cd dist | ||
| 7z a msxtileforge_windows.zip msxtileforge | ||
| - name: Upload Windows Artifact | ||
| id: upload | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: windows-build-${{ inputs.version_string }} | ||
| path: dist/msxtileforge_windows.zip | ||