Skip to content

Commit

Permalink
Merge pull request #61 from AungA07/workflow
Browse files Browse the repository at this point in the history
Workflow
  • Loading branch information
AungA07 authored Dec 4, 2024
2 parents a487604 + 978d9ba commit 56a43df
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 6 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build_on_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build on Release

on:
release:
types: [published]

permissions:
contents: write
packages: write

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build On Windows
run: |
echo "Building on Windows"
# Set-up chocolatey
Set-ExecutionPolicy AllSigned
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Install Inno Setup Command Line Compiler
choco install innosetup
# Build .exe
pyinstaller build_instructions/EasyPunchCard.spec
# Build Installer
iscc build_instructions/easypunchcard_setup_script.iss
# delete all artifacts except
powershell -Command "Get-ChildItem 'dist' -File | Where-Object { $_.Name -ne 'EasyPunchCard_setup.exe' } | Remove-Item"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ runner.os }}-${{ github.run_id }}
path: dist/

- name: Upload Windows Release Asset
if: runner.os == 'Windows'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/EasyPunchCard_setup.exe # Replace with actual artifact name
asset_name: EasyPunchCard.exe # Replace with actual artifact name
asset_content_type: application/octet-stream
10 changes: 5 additions & 5 deletions build_instructions/easypunchcard_setup_script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ ArchitecturesAllowed=x64compatible
; the 64-bit view of the registry.
ArchitecturesInstallIn64BitMode=x64compatible
DisableProgramGroupPage=yes
LicenseFile=C:\Users\admin\Desktop\repos\EasyPunchCard\LICENSE
LicenseFile=..\LICENSE
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=C:\Users\admin\Desktop
OutputBaseFilename=EasyPunchCard_WINDOWS_1.0_setup
SetupIconFile=C:\Users\admin\Desktop\repos\EasyPunchCard\assets\windows_setup_image.ico
OutputDir=..\dist
OutputBaseFilename=EasyPunchCard_setup
SetupIconFile=..\assets\windows_setup_image.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
Expand All @@ -46,7 +46,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "C:\Users\admin\Desktop\repos\EasyPunchCard\dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ pytz==2024.2
six==1.16.0
tzdata==2024.2
reportlab==4.2.5
tkcalendar~=1.6.1
tkcalendar~=1.6.1
pyinstaller

0 comments on commit 56a43df

Please sign in to comment.