|
1 |
| -name: Build & Release Executable |
| 1 | +name: Windows Build & Release |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches:
|
6 |
| - - main # Runs only on push to main |
7 |
| - workflow_dispatch: # Allow manual trigger |
| 6 | + - main |
8 | 7 |
|
9 | 8 | jobs:
|
10 | 9 | build:
|
11 | 10 | runs-on: windows-latest
|
12 | 11 |
|
13 | 12 | steps:
|
14 |
| - - name: Checkout Repository |
| 13 | + - name: Checkout repository |
15 | 14 | uses: actions/checkout@v4
|
16 | 15 |
|
17 | 16 | - name: Set up Python
|
18 | 17 | uses: actions/setup-python@v4
|
19 | 18 | with:
|
20 |
| - python-version: '3.10' |
| 19 | + python-version: '3.12' |
21 | 20 |
|
22 |
| - - name: Install Dependencies |
| 21 | + - name: Install dependencies |
23 | 22 | run: |
|
24 | 23 | python -m pip install --upgrade pip
|
25 | 24 | pip install -r requirements.txt
|
26 | 25 | pip install pyinstaller
|
27 | 26 |
|
28 |
| - - name: Build Executables |
| 27 | + - name: Build executables with PyInstaller |
29 | 28 | run: |
|
30 | 29 | pyinstaller recover.py --noconfirm --onefile --name "Data Recovery - Console" --console
|
31 | 30 | pyinstaller recover.py --noconfirm --onefile --name "Data Recovery - Hidden" --windowed
|
32 | 31 |
|
33 |
| - - name: Rename Executables |
| 32 | + - name: Rename files |
34 | 33 | run: |
|
35 |
| - mv dist/"Data Recovery - Console.exe" dist/data_recovery_console.exe |
36 |
| - mv dist/"Data Recovery - Hidden.exe" dist/data_recovery_hidden.exe |
37 |
| -
|
38 |
| - - name: Get Last Commit Hash |
39 |
| - id: get_commit |
40 |
| - run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
| 34 | + Rename-Item -Path dist/"Data Recovery - Console.exe" -NewName data_recovery_console.exe |
| 35 | + Rename-Item -Path dist/"Data Recovery - Hidden.exe" -NewName data_recovery_hidden.exe |
41 | 36 |
|
42 | 37 | - name: Create Tag
|
| 38 | + id: create_tag |
43 | 39 | run: |
|
44 |
| - git tag ${{ env.COMMIT_HASH }} |
45 |
| - git push origin ${{ env.COMMIT_HASH }} |
46 |
| - env: |
47 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + $TAG="v1.0.$env:GITHUB_RUN_NUMBER" |
| 41 | + echo "TAG_NAME=$TAG" >> $env:GITHUB_ENV |
| 42 | + git tag $TAG |
| 43 | + git push origin $TAG |
| 44 | + shell: pwsh |
48 | 45 |
|
49 | 46 | - name: Create GitHub Release
|
50 | 47 | uses: softprops/action-gh-release@v2
|
51 | 48 | with:
|
52 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
53 |
| - tag_name: ${{ env.COMMIT_HASH }} |
54 |
| - name: Release ${{ env.COMMIT_HASH }} # Corrected 'release_name' to 'name' |
| 49 | + tag_name: ${{ env.TAG_NAME }} |
| 50 | + name: "Release ${{ env.TAG_NAME }}" |
55 | 51 | draft: false
|
56 | 52 | prerelease: false
|
57 | 53 | files: |
|
|
0 commit comments