diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..31b89197 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,112 @@ +name: Release Pipeline + +on: + push: + tags: [ '*' ] + +jobs: + + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + + # Only needed to work around missing libraries from current PyDCS module + - uses: actions/checkout@v2 + with: + repository: "${{github['repository_owner']}}/dcs" + path: '.\pydcs' + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install environment + run: | + py -m venv ./venv + + - name: Install dependencies + run: | + ./venv/scripts/activate + pip install -r requirements.txt + # Workaround for the missing libraries needed for Syria within the PyDCS module. + Copy-Item .\pydcs\dcs .\venv\Lib\site-packages\ -Container -Recurse -Force + Copy-Item .\venv\Lib\site-packages\shiboken2\shiboken2.abi3.dll .\venv\Lib\site-packages\PySide2\ -Force + + - name: Build binaries + run: | + ./venv/scripts/activate + $env:PYTHONPATH="." + pyinstaller pyinstaller.spec + + - name: Create Installer + env: + TAG_NAME: ${{ github.ref }} + run: | + $version = ($env:TAG_NAME -split "/") | Select-Object -Last 1 + (Get-Content .\msi_installer\dcs_liberation.iss) -replace "{{version}}",$version | Out-File .\build\installer.iss + cd .\msi_installer + iscc.exe ..\build\installer.iss + cd .. + Copy-Item .\changelog.md .\dist + + - uses: actions/upload-artifact@v2 + with: + name: dcs_liberation + path: dist/ + + release: + needs: [ build ] + runs-on: windows-latest + steps: + - uses: actions/download-artifact@v2 + with: + name: dcs_liberation + + - name: "Get Version" + id: version + env: + TAG_NAME: ${{ github.ref }} + run: | + Get-ChildItem -Recurse -Depth 1 + $version = ($env:TAG_NAME -split "/") | Select-Object -Last 1 + $prerelease = $version -match '[^\.\d]' + Write-Host $version + Write-Host $prerelease + Write-Output "::set-output name=number::$version" + Write-Output "::set-output name=prerelease::$prerelease" + $changelog = Get-Content .\changelog.md + $last_change = ($changelog | Select-String -Pattern "^#\s" | Select-Object -Skip 1 -First 1).LineNumber - 2 + ($changelog | Select-Object -First $last_change) -join "`n" | Out-File .\releasenotes.md + Compress-Archive -Path .\dcs_liberation -DestinationPath "dcs_liberation.$version.zip" -Compression Optimal + + - uses: actions/create-release@v1 + id: create_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body_path: releasenotes.md + draft: false + prerelease: ${{ steps.version.outputs.prerelease }} + + - uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dcs_liberation.exe + asset_name: dcs_liberation.${{ steps.version.outputs.number }}.exe + asset_content_type: application/exe + + - uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dcs_liberation.${{ steps.version.outputs.number }}.zip + asset_name: dcs_liberation.${{ steps.version.outputs.number }}.zip + asset_content_type: application/zip + \ No newline at end of file diff --git a/changelog.md b/changelog.md index 3f2afbb2..86772bff 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # 2.1.1 +## Features/Imrpovements : +* **[Other]** Added an installer option ## Fixed issues : * **[UI/UX]** Spelling issues diff --git a/msi_installer/ISCC.exe b/msi_installer/ISCC.exe new file mode 100644 index 00000000..72a8c55b Binary files /dev/null and b/msi_installer/ISCC.exe differ diff --git a/msi_installer/dcs_liberation.iss b/msi_installer/dcs_liberation.iss new file mode 100644 index 00000000..cd53dda3 --- /dev/null +++ b/msi_installer/dcs_liberation.iss @@ -0,0 +1,51 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "DCS Liberation" +#define MyAppVersion "{{version}}" +#define MyAppPublisher "Khopa" +#define MyAppURL "https://github.com/Khopa/dcs_liberation/wiki" +#define MyAppExeName "liberation_main.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{6753B352-D281-42CB-9AFA-5E93EB90AA5A} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +DefaultGroupName={#MyAppName} +AllowNoIcons=yes +; Remove the following line to run in administrative install mode (install for all users.) +PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +OutputDir=..\dist +OutputBaseFilename=dcs_liberation +SetupIconFile=..\resources\icon.ico +UninstallDisplayIcon={app}\liberation_main.exe +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "..\dist\dcs_liberation\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent +