Skip to content

Commit 4a971fb

Browse files
committed
a
1 parent ed22dab commit 4a971fb

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,53 @@
1-
name: Build & Release Executable
1+
name: Windows Build & Release
22

33
on:
44
push:
55
branches:
6-
- main # Runs only on push to main
7-
workflow_dispatch: # Allow manual trigger
6+
- main
87

98
jobs:
109
build:
1110
runs-on: windows-latest
1211

1312
steps:
14-
- name: Checkout Repository
13+
- name: Checkout repository
1514
uses: actions/checkout@v4
1615

1716
- name: Set up Python
1817
uses: actions/setup-python@v4
1918
with:
20-
python-version: '3.10'
19+
python-version: '3.12'
2120

22-
- name: Install Dependencies
21+
- name: Install dependencies
2322
run: |
2423
python -m pip install --upgrade pip
2524
pip install -r requirements.txt
2625
pip install pyinstaller
2726
28-
- name: Build Executables
27+
- name: Build executables with PyInstaller
2928
run: |
3029
pyinstaller recover.py --noconfirm --onefile --name "Data Recovery - Console" --console
3130
pyinstaller recover.py --noconfirm --onefile --name "Data Recovery - Hidden" --windowed
3231
33-
- name: Rename Executables
32+
- name: Rename files
3433
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
4136
4237
- name: Create Tag
38+
id: create_tag
4339
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
4845

4946
- name: Create GitHub Release
5047
uses: softprops/action-gh-release@v2
5148
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 }}"
5551
draft: false
5652
prerelease: false
5753
files: |

0 commit comments

Comments
 (0)