Version 2.3.3 #4
Workflow file for this run
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
| name: Build & Deploy | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-deploy-python-package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| python -m pip install twine | |
| pip install -r requirements.txt | |
| - name: Build Package | |
| run: python -m build | |
| - name: Publish Package | |
| run: python3 -m twine upload dist/* --verbose | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{secrets.PYPI_API_TOKEN}} | |
| build-windows-app: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| pip install -r requirements.txt | |
| - name: Generate version file | |
| run: | | |
| python -c " | |
| import tomllib | |
| # Read version from pyproject.toml | |
| with open('pyproject.toml', 'rb') as f: | |
| pyproject = tomllib.load(f) | |
| version = pyproject['project']['version'] | |
| parts = version.split('.') | |
| major, minor, patch = parts[0], parts[1], parts[2] if len(parts) > 2 else '0' | |
| print(f'Using version: {version}') | |
| version_file = f''' | |
| VSVersionInfo( | |
| ffi=FixedFileInfo( | |
| filevers=({major}, {minor}, {patch}, 0), | |
| prodvers=({major}, {minor}, {patch}, 0), | |
| mask=0x3f, | |
| flags=0x0, | |
| OS=0x40004, | |
| fileType=0x1, | |
| subtype=0x0, | |
| date=(0, 0) | |
| ), | |
| kids=[ | |
| StringFileInfo( | |
| [ | |
| StringTable( | |
| '040904B0', | |
| [StringStruct('CompanyName', 'Nathan Fiscaletti'), | |
| StringStruct('FileDescription', 'Keyboard Sounds'), | |
| StringStruct('FileVersion', '{version}'), | |
| StringStruct('InternalName', 'kbs'), | |
| StringStruct('LegalCopyright', 'Copyright (c) 2025 Nathan Fiscaletti'), | |
| StringStruct('OriginalFilename', 'kbs.exe'), | |
| StringStruct('ProductName', 'Keyboard Sounds'), | |
| StringStruct('ProductVersion', '{version}')]) | |
| ]), | |
| VarFileInfo([VarStruct('Translation', [1033, 1200])]) | |
| ] | |
| ) | |
| ''' | |
| with open('app-version.txt', 'w') as f: | |
| f.write(version_file) | |
| print('Generated app-version.txt') | |
| " | |
| shell: pwsh | |
| - name: Build portable distribution | |
| run: pyinstaller --distpath ./kbs-dist kbs.spec | |
| - name: Copy runtime to application | |
| run: | | |
| New-Item -ItemType Directory -Force -Path ./application/.runtime | |
| Copy-Item -Path ./kbs-dist/kbs/* -Destination ./application/.runtime -Recurse -Force | |
| shell: pwsh | |
| - name: Copy profiles to application | |
| run: | | |
| Copy-Item -Path ./keyboardsounds/profiles -Destination ./application/.runtime/profiles -Recurse | |
| shell: pwsh | |
| - name: Install Node.js | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm install | |
| working-directory: ./application | |
| - name: Package Webpack | |
| run: npm run package | |
| working-directory: ./application | |
| - name: Build Installer | |
| run: npm run make-installer:win | |
| working-directory: ./application | |
| env: | |
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Rename Installer | |
| run: mv "dist/Keyboard Sounds Setup *.exe" "dist/Keyboard-Sounds-Setup-windows-x64.exe" | |
| working-directory: ./application | |
| - name: Rename Blockmap | |
| run: mv "dist/Keyboard Sounds Setup *.exe.blockmap" "dist/Keyboard-Sounds-Setup-windows-x64.exe.blockmap" | |
| working-directory: ./application | |
| - name: Upload Artifacts | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| application/dist/Keyboard-Sounds-Setup-windows-x64.exe | |
| application/dist/Keyboard-Sounds-Setup-windows-x64.exe.blockmap | |
| build-linux-app: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| pip install -r requirements.txt | |
| - name: Build Runtime | |
| uses: coactions/setup-xvfb@v1 | |
| with: | |
| run: ./build-runtime.sh | |
| - name: Copy profiles to application | |
| run: | | |
| Copy-Item -Path ./keyboardsounds/profiles -Destination ./application/.runtime/profiles -Recurse | |
| shell: pwsh | |
| - name: Install Node.js | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm install | |
| working-directory: ./application | |
| - name: Package Webpack | |
| run: npm run package | |
| working-directory: ./application | |
| - name: Build Installer | |
| run: npm run make-installer:linux | |
| working-directory: ./application | |
| env: | |
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Rename Installer | |
| run: mv dist/kbs_*_amd64.deb dist/Keyboard-Sounds-amd64.deb | |
| working-directory: ./application | |
| - name: Upload Artifacts | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| application/dist/Keyboard-Sounds-amd64.deb |