Skip to content

Commit 1ac4230

Browse files
committed
Add version on CI build
1 parent dadfd10 commit 1ac4230

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
env:
5151
BINARY_NAME: ${{ steps.binary-name.outputs.binary }}
5252
run: |
53+
echo '__version__ = "${GITHUB_REF_NAME}"' > app/version.py
5354
pyinstaller --onefile main.py --name $BINARY_NAME
5455
5556
- name: Create GitHub Release
@@ -307,8 +308,18 @@ jobs:
307308
python -m pip install --upgrade pip
308309
pip install -r requirements.txt
309310
311+
- name: Get version from tag
312+
id: get_version
313+
shell: pwsh
314+
run: |
315+
$version = "${{ github.ref_name }}"
316+
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
317+
310318
- name: Build binary
319+
shell: pwsh
311320
run: |
321+
$version_content = "__version__ = `"${{ github.ref_name }}`""
322+
$version_content | Out-File -FilePath app/version.py -Encoding utf8
312323
pyinstaller --onefile --name gitmastery main.py
313324
314325
- name: Create GitHub Release
@@ -337,6 +348,7 @@ jobs:
337348
338349
- name: Build binary
339350
run: |
351+
echo '__version__ = "${GITHUB_REF_NAME}"' > app/version.py
340352
pyinstaller --onefile --name gitmastery main.py
341353
342354
- name: Generate SHA256

0 commit comments

Comments
 (0)