Skip to content

Commit

Permalink
add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
fralonra committed Aug 4, 2023
1 parent f659080 commit 7f22ab0
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
push:
tags: ['v[0-9]+.[0-9]+.[0-9]+*']

jobs:
linux:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v3
- name: Install dependencies on Ubuntu
run: sudo apt-get update && sudo apt-get install libgtk-3-dev
- name: Build
run: GIT_COMMIT_HASH=$(git rev-parse --short HEAD) cargo build --release
- name: Gzip
run: |
mkdir ppd-editor
mv ./target/release/ppd-editor ppd-editor/
tar -zcvf ./ppd-editor-linux-${{ github.ref_name }}.tar.gz ppd-editor
mkdir ppd-viewer
mv ./target/release/ppd-viewer ppd-viewer/
tar -zcvf ./ppd-viewer-linux-${{ github.ref_name }}.tar.gz ppd-viewer
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./ppd-editor-linux-${{ github.ref_name }}.tar.gz
./ppd-viewer-linux-${{ github.ref_name }}.tar.gz
windows:
runs-on: windows-latest
defaults:
run:
shell: bash
permissions:
contents: write

steps:
- uses: actions/checkout@v3
- name: Build
run: GIT_COMMIT_HASH=$(git rev-parse --short HEAD) cargo build --release
- name: Install WiX
run: nuget install WiX -Version 3.11.2
- name: Create msi installer
run: |
./WiX.*/tools/candle.exe -arch "x64" -ext WixUIExtension -ext WixUtilExtension \
-out "./ppd-editor.wixobj" "build/windows/wix/ppd-editor.wxs"
./WiX.*/tools/light.exe -ext WixUIExtension -ext WixUtilExtension \
-out "./ppd-editor-windows-${{ github.ref_name }}.msi" -sice:ICE61 -sice:ICE91 \
"./ppd-editor.wixobj"
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ./ppd-editor-windows-${{ github.ref_name }}.msi
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Fralonra

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions build/windows/wix/license.rtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{\rtf1
MIT License\
\
Copyright (c) 2023 Fralonra\
\
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\
\
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\
\
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\
}
93 changes: 93 additions & 0 deletions build/windows/wix/ppd-editor.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="windows-1252"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Name="PpdEditor"
Id="*"
UpgradeCode="7c3c9894-b3d3-4e6a-b71a-4187e60183b3"
Language="1033"
Codepage="1252"
Version="0.1.0"
Manufacturer="Fralonra">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<Icon Id="PpdEditorIcon" SourceFile=".\build\windows\ppd-editor.ico"/>
<Icon Id="PpdViewerIcon" SourceFile=".\build\windows\ppd-viewer.ico"/>
<WixVariable Id="WixUILicenseRtf" Value=".\build\windows\wix\license.rtf"/>
<Property Id="ARPPRODUCTICON" Value="PpdEditorIcon"/>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch PpdEditor"/>
<Property Id="WixShellExecTarget" Value="[#PpdEditorExeFile]"/>
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
<MediaTemplate EmbedCab="yes"/>

<UI>
<UIRef Id="WixUI_Advanced"/>
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLDIR" Name="PpdEditor"/>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenu" Name="PpdEditor"/>
</Directory>
</Directory>

<DirectoryRef Id="INSTALLDIR">
<Component Id="PpdEditorExe" Guid="*">
<File Id="PpdEditorExeFile" Source=".\target\release\ppd-editor.exe" Name="ppd-editor.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="PpdViewerExe" Guid="*">
<File Id="PpdViewerExeFile" Source=".\target\release\ppd-viewer.exe" Name="ppd-viewer.exe" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>

<DirectoryRef Id="ProgramMenu">
<Component Id="Shortcut" Guid="*">
<Shortcut Id="ShortcutFile"
Icon="PpdEditorIcon"
Name="PpdEditor"
Description="Paperdoll Editor"
Target="[!PpdEditorExeFile]"
WorkingDirectory="INSTALLDIR"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall PpdEditor"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstalls PpdEditor" />
<RemoveFolder Id="ProgramMenu" Directory="ProgramMenu" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Fralonra\PpdEditor" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
<Component Id="ShortcutViewer" Guid="*">
<Shortcut Id="ShortcutViewerFile"
Icon="PpdViewerIcon"
Name="PpdViewer"
Description="Paperdoll Viewer"
Target="[!PpdViewerExeFile]"
WorkingDirectory="INSTALLDIR"/>
<RemoveFolder Id="ProgramMenu" Directory="ProgramMenu" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Fralonra\PpdViewer" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>

<DirectoryRef Id="INSTALLDIR">
<Component Id="ModifyPathEnv" Guid="4e6e462c-8e9e-45b8-ab8a-8de938d4961f" KeyPath="yes">
<Environment Id="PathEnv" Value="[INSTALLDIR]" Name="PATH" Permanent="no" Part="first" Action="set" System="yes"/>
</Component>
</DirectoryRef>

<Feature Id="PpdEditor" Title="Paperdoll Editor" Level="1">
<ComponentRef Id="PpdEditorExe"/>
<ComponentRef Id="Shortcut"/>
<ComponentRef Id="ModifyPathEnv"/>
</Feature>

<Feature Id="PpdViewer" Title="Paperdoll Viewer" Level="1">
<ComponentRef Id="PpdViewerExe"/>
<ComponentRef Id="ShortcutPpdViewer"/>
</Feature>
</Product>
</Wix>

0 comments on commit 7f22ab0

Please sign in to comment.