refactor: modernize build script and initialize core source structure… #103
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: Dev Release | |
| on: | |
| push: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install Python dependencies | |
| run: pip install -r requirements.txt | |
| - name: Install Velopack CLI | |
| run: | | |
| dotnet tool install -g vpk | |
| echo "$HOME\.dotnet\tools" >> $env:GITHUB_PATH | |
| - name: Build All | |
| run: python makefile.py --build-all --dev | |
| - name: Read app version | |
| id: version | |
| run: | | |
| $ver = python -c "from src.common import app_version; print(app_version)" | |
| $ver = "$ver-dev.${{ github.run_number }}" | |
| echo "app_version=$ver" >> $env:GITHUB_OUTPUT | |
| - name: Velopack Pack | |
| run: | | |
| & "$HOME\.dotnet\tools\vpk.exe" pack --packId Hammer5Tools --packVersion ${{ steps.version.outputs.app_version }} --packDir Hammer5Tools --mainExe Hammer5Tools.exe --icon src/appicon.ico --channel dev --noPortable | |
| - name: Delete old dev release | |
| run: gh release delete dev --yes --cleanup-tag | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| continue-on-error: true | |
| - name: Velopack Upload | |
| run: | | |
| & "$HOME\.dotnet\tools\vpk.exe" upload github --repoUrl https://github.com/dertwist/Hammer5Tools --publish --token ${{ secrets.GITHUB_TOKEN }} --channel dev --tag dev --pre | |