Auto packaging for windows with GitHub actions
This commit is contained in:
79
.github/workflows/windows-packaging.yml
vendored
Normal file
79
.github/workflows/windows-packaging.yml
vendored
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
name: Auto Packaging - Windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
windows-packaging:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Use Python 3.10
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r ./requirements/requirements.txt
|
||||||
|
|
||||||
|
- name: Install PyInstaller
|
||||||
|
run: |
|
||||||
|
pip install pyinstaller
|
||||||
|
|
||||||
|
- name: Build Artemis main executables and
|
||||||
|
run: |
|
||||||
|
CD spec_files\Windows
|
||||||
|
|
||||||
|
ECHO "Building Artemis executable..."
|
||||||
|
MKDIR output
|
||||||
|
pyinstaller artemis.spec
|
||||||
|
MOVE dist\Artemis.exe .\output\Artemis.exe
|
||||||
|
RMDIR -recurse -force dist
|
||||||
|
RMDIR -recurse -force build
|
||||||
|
|
||||||
|
ECHO "Building updater..."
|
||||||
|
pyinstaller updater.spec
|
||||||
|
MOVE dist\_ArtemisUpdater.exe .\output\_ArtemisUpdater.exe
|
||||||
|
RMDIR -recurse -force dist
|
||||||
|
RMDIR -recurse -force build
|
||||||
|
|
||||||
|
CD output
|
||||||
|
MKDIR Artemis
|
||||||
|
XCOPY /y Artemis.exe Artemis\
|
||||||
|
XCOPY /e /k /y ..\..\..\src\themes Artemis\themes\ /EXCLUDE:..\excluded_files.txt
|
||||||
|
XCOPY /y _ArtemisUpdater.exe Artemis\
|
||||||
|
|
||||||
|
ECHO "Compress files themes+Artemis.exe -> Artemis.zip"
|
||||||
|
$compress = @{
|
||||||
|
Path = ".\Artemis.exe", "..\..\..\src\themes"
|
||||||
|
CompressionLevel = "Optimal"
|
||||||
|
DestinationPath = ".\Artemis_win.zip"
|
||||||
|
}
|
||||||
|
Compress-Archive @compress
|
||||||
|
|
||||||
|
$compress = @{
|
||||||
|
Path = ".\_ArtemisUpdater.exe"
|
||||||
|
CompressionLevel = "Optimal"
|
||||||
|
DestinationPath = ".\_ArtemisUpdater_win.zip"
|
||||||
|
}
|
||||||
|
Compress-Archive @compress
|
||||||
|
|
||||||
|
ECHO "Compress all files for website download"
|
||||||
|
$compress = @{
|
||||||
|
Path = "Artemis"
|
||||||
|
CompressionLevel = "Optimal"
|
||||||
|
DestinationPath = ".\ArtemisWebsite_win.zip"
|
||||||
|
}
|
||||||
|
Compress-Archive @compress
|
||||||
|
|
||||||
|
python ..\..\__get_hash_code.py Artemis_win.zip _ArtemisUpdater_win.zip ArtemisWebsite_win.zip > checksum.txt
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Artemis_Windows
|
||||||
|
path: |
|
||||||
|
.\spec_files\Windows\output\Artemis_win.zip
|
||||||
|
.\spec_files\Windows\output\_ArtemisUpdater_win.zip
|
||||||
|
.\spec_files\Windows\output\ArtemisWebsite_win.zip
|
||||||
|
.\spec_files\Windows\output\checksum.txt
|
||||||
Reference in New Issue
Block a user