|
1 |
| -name: Build DBCompare Executable |
| 1 | +name: Create Release |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 |
| - tags: |
6 |
| - - 'v*' # This will trigger the workflow for any tag starting with 'v' |
| 5 | + branches: |
| 6 | + - develop |
7 | 7 |
|
8 | 8 | jobs:
|
9 | 9 | build:
|
10 | 10 | runs-on: windows-latest
|
11 |
| - |
12 | 11 | steps:
|
13 |
| - - uses: actions/checkout@v4 |
| 12 | + - uses: actions/checkout@v2 |
14 | 13 |
|
15 | 14 | - name: Set up Python
|
16 |
| - uses: actions/setup-python@v4 |
| 15 | + uses: actions/setup-python@v2 |
17 | 16 | with:
|
18 | 17 | python-version: '3.x'
|
19 | 18 |
|
20 |
| - - name: Install dependencies |
21 |
| - run: | |
22 |
| - python -m pip install --upgrade pip |
23 |
| - pip install pyinstaller pillow |
24 |
| - |
25 |
| - - name: Convert PNG to ICO |
26 |
| - run: | |
27 |
| - python -c "from PIL import Image; img = Image.open('img/icon.png'); img.save('icon.ico')" |
| 19 | + - name: Install PyInstaller |
| 20 | + run: pip install pyinstaller |
28 | 21 |
|
29 | 22 | - name: Build executable
|
30 |
| - run: | |
31 |
| - pyinstaller --onefile --windowed --add-data "img/icon.png;img" --icon="icon.ico" main.py |
32 |
| - |
33 |
| - - name: List dist directory # Check if the executable is created |
34 |
| - run: dir dist # For Windows, this will list files in the dist directory |
35 |
| - |
36 |
| - - name: Create ZIP file |
37 |
| - run: | |
38 |
| - Compress-Archive -Path dist\dbcompare.exe -DestinationPath dbcompare.zip |
| 23 | + run: pyinstaller --onefile --windowed main.py |
39 | 24 |
|
40 | 25 | - name: Create Release
|
41 |
| - uses: softprops/action-gh-release@v1 |
| 26 | + id: create_release |
| 27 | + uses: actions/create-release@v1 |
| 28 | + env: |
| 29 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
42 | 30 | with:
|
43 |
| - tag_name: ${{ github.ref }} # Use the tag that triggered this workflow |
44 |
| - files: | |
45 |
| - dist\dbcompare.exe |
46 |
| - dbcompare.zip |
47 |
| - name: Release ${{ github.ref_name }} |
48 |
| - body: This is a new release of DBCompare. |
| 31 | + tag_name: v${{ github.run_number }} |
| 32 | + release_name: Release v${{ github.run_number }} |
| 33 | + draft: false |
| 34 | + prerelease: false |
| 35 | + |
| 36 | + - name: Upload Release Asset |
| 37 | + uses: actions/upload-release-asset@v1 |
49 | 38 | env:
|
50 | 39 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 40 | + with: |
| 41 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 42 | + asset_path: ./dist/main.exe |
| 43 | + asset_name: main.exe |
| 44 | + asset_content_type: application/octet-stream |
0 commit comments