Skip to content

Commit 278cb95

Browse files
committed
improve workflows, add pytest_results to gitignore
1 parent a1b3633 commit 278cb95

3 files changed

Lines changed: 37 additions & 6 deletions

File tree

.github/workflows/script-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
pip install -r requirements.txt
2929
3030
- name: PyInstaller
31-
run: pyinstaller main.py --name ${{ github.repository }}_${{ github.ref_name }}_${{ matrix.os }}
31+
run: pyinstaller main.py --name ${{ github.repository_owner }}-${{ github.repository_id }}@${{ github.sha }}_${{ matrix.os }}
3232

3333
- name: Upload Builds
3434
uses: actions/upload-artifact@v4

.github/workflows/script-release.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,41 @@ jobs:
3838
pip install -r requirements.txt
3939
4040
- name: PyInstaller
41-
run: pyinstaller --onefile --windowed main.py --name ${{ github.repository }}_${{ github.ref_name }}_${{ matrix.os }}
41+
run: pyinstaller --onefile --windowed main.py --name ${{ github.repository_id }}_${{ matrix.os }}
4242

4343
- name: List dist directory
4444
run: ls -R dist
4545

4646
- name: Tar files on Linux
4747
if: ${{ matrix.runner_os == 'ubuntu-latest' }}
4848
run: |
49-
chmod +x dist/${{ github.repository }}_${{ github.ref_name }}_${{ matrix.os }}
50-
tar -czvf dist/${{ github.repository }}_${{ github.ref_name }}_${{ matrix.os }}.tar.gz dist/${{ github.repository }}_${{ github.ref_name }}_${{ matrix.os }}
51-
rm -rf dist/${{ github.repository }}_${{ github.ref_name }}_${{ matrix.os }}
49+
chmod +x dist/${{ github.repository_id }}_${{ matrix.os }}
50+
tar -czvf dist/${{ github.repository_id }}@${{ github.ref_name }}_${{ matrix.os }}.tar.gz dist/${{ github.repository_id }}_${{ matrix.os }}
51+
rm -rf dist/${{ github.repository_id }}_${{ matrix.os }}
52+
53+
- name: Zip artifact on Mac
54+
if: ${{ matrix.runner_os == 'macos-latest' }}
55+
run: |
56+
zip -r ${{ github.repository_id }}@${{ github.ref_name }}_${{ matrix.os }}.zip dist/
57+
rm -rf dist/
58+
mkdir dist/
59+
mv ${{ github.repository_id }}@${{ github.ref_name }}_${{ matrix.os }}.zip dist/
60+
61+
- name: Zip files on Windows
62+
if: ${{ matrix.runner_os == 'windows-latest' }}
63+
run: |
64+
$itemsToZip = @(".\dist\${{ matrix.os }}_cmd-release", ".\dist\${{ matrix.os }}_cli-release")
65+
Compress-Archive -Path $itemsToZip -DestinationPath ".\dist\${{ github.repository_id }}@${{ github.ref_name }}_${{ matrix.os }}.zip"
66+
if (Test-Path ".\dist\${{ github.repository_id }}@${{ github.ref_name }}_${{ matrix.os }}.zip") {
67+
foreach ($item in $itemsToZip) {
68+
Remove-Item -Path $item -Recurse -Force
69+
}
70+
Write-Output "Files zipped and originals deleted successfully."
71+
exit 0
72+
} else {
73+
Write-Output "Failed to create zip file. Source files were not deleted."
74+
exit 1
75+
}
5276
5377
- name: Upload debug builds
5478
uses: actions/upload-artifact@v4
@@ -82,7 +106,7 @@ jobs:
82106
token: ${{ secrets.GITHUB_TOKEN }}
83107
generateReleaseNotes: true
84108
tag: ${{ github.ref_name }}
85-
artifacts:
109+
artifacts: release-artifacts/*_dists/${{ github.repository_id }}_*
86110
draft: true
87111
name: "${{ github.repository }}_${{ github.ref_name }}_*"
88112
body: "Need help? Refer to the documentation site."

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ coverage.xml
5151
.pytest_cache/
5252
cover/
5353

54+
# Pytest results should not be uploaded to version control, as they are not needed.
55+
# However, pytest doesn't usually output results into a file, so people may use >>
56+
# to direct output to a file.
57+
# The recommended file name is pytest_results, which is commented below.
58+
# Uncomment to ignore the file name.
59+
#pytest_results
60+
5461
# Translations
5562
*.mo
5663
*.pot

0 commit comments

Comments
 (0)