Merge pull request #1 from LexianDEV/copilot/fix-32610bab-38be-4026-8… #9
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: Package Application with PyInstaller for Windows | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| tags: | |
| - "v*" | |
| - "b*" | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository (with submodules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Package Application with PyInstaller | |
| run: | | |
| pyinstaller build.spec | |
| - name: Upload debug build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dev-build | |
| path: dist | |
| - name: Extract changelog entry | |
| if: startsWith(github.ref, 'refs/tags/') | |
| id: changelog | |
| shell: bash | |
| run: | | |
| version=${GITHUB_REF_NAME#v} | |
| echo "Extracting changelog for version $version" | |
| # Extract the changelog section for this version | |
| if grep -q "## \[$version\]" CHANGELOG.md; then | |
| # Extract content between this version and the next version heading or links section | |
| changelog_content=$(awk "/## \[$version\]/{flag=1; next} /## \[|^\[.*\]:/{flag=0} flag" CHANGELOG.md | sed '/^$/d') | |
| echo "Changelog content found for version $version" | |
| else | |
| echo "No changelog entry found for version $version, using default message" | |
| changelog_content="Release $version - See CHANGELOG.md for details" | |
| fi | |
| # Store in output for use in release step | |
| echo "content<<EOF" >> $GITHUB_OUTPUT | |
| echo "$changelog_content" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Upload Release Asset | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/Application.exe | |
| prerelease: ${{ startsWith(github.ref_name, 'b') }} | |
| body: ${{ steps.changelog.outputs.content }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |