Create Release #8
Workflow file for this run
This file contains 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 DBCompare Executable | |
on: | |
push: | |
tags: | |
- 'v*' # This will trigger the workflow for any tag starting with 'v' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller pillow | |
- name: Convert PNG to ICO | |
run: | | |
python -c "from PIL import Image; img = Image.open('img/icon.png'); img.save('icon.ico')" | |
- name: Build executable | |
run: | | |
pyinstaller --onefile --windowed --add-data "img/icon.png;img" --icon="icon.ico" main.py | |
- name: List dist directory # Check if the executable is created | |
run: dir dist # For Windows, this will list files in the dist directory | |
- name: Create ZIP file | |
run: | | |
Compress-Archive -Path dist\dbcompare.exe -DestinationPath dbcompare.zip | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref }} # Use the tag that triggered this workflow | |
files: | | |
dist\dbcompare.exe | |
dbcompare.zip | |
name: Release ${{ github.ref_name }} | |
body: This is a new release of DBCompare. | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |