Skip to content

Commit

Permalink
Use default tool commands
Browse files Browse the repository at this point in the history
(References: #42)
  • Loading branch information
Aszusz committed Mar 12, 2024
1 parent 3a9c4b9 commit 5453c4b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 38 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,11 @@ jobs:
shell: cmd
run: >
ant
-buildfile MoonshineSDKInstaller/build/build.xml all
-DHAXEPATH="C:\hostedtoolcache\windows\haxe\4.2.5\x64"
-DHAXE_HOME="C:\hostedtoolcache\windows\haxe\4.2.5\x64\lib"
-DNSIS_HOME="C:\Program Files (x86)\NSIS"
-buildfile MoonshineSDKInstaller/build/build.xml all
-Dapp.version=${{ inputs.version }}
-Dbuild.is.signed=true
-Dbuild.is.development=${{ inputs.env != 'production' }}
- name: Sign using action
uses: Moonshine-IDE/digicert-sign-action@main
with:
bin-path: MoonshineSDKInstaller/build/bin/MoonshineSDKInstaller-1.2.3.exe
sm-host: ${{ secrets.SM_HOST }}
sm-api-key: ${{ secrets.SM_API_KEY }}
sm-client-cert-file-b64: ${{ secrets.SM_CLIENT_CERT_FILE_B64 }}
sm-client-cert-password: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
sm-code-signing-cert-sha1-hash: ${{ secrets.SM_THUMBPRINT }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
Expand Down
38 changes: 18 additions & 20 deletions MoonshineSDKInstaller/build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
<!-- ANCHOR - Tools -->
<property name="JAVA_HOME" value="${env.JAVA_HOME}"/>
<property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
<property name="mxmlc_path" value="${FLEX_HOME}/lib/mxmlc.jar"/>
<property name="adt_path" value="${FLEX_HOME}/lib/adt.jar"/>
<property name="HAXEPATH" value="${env.HAXEPATH}"/>
<property name="HAXE_HOME" value="${env.HAXE_HOME}"/>
<property name="SIGNTOOL_HOME" value="${env.SIGNTOOL_HOME}"/>
<property name="NSIS_HOME" value="${env.NSIS_HOME}"/>
<property name="adt.cmd" value="${FLEX_HOME}/lib/adt.jar"/>
<property name="haxelib.cmd" value="haxelib"/>
<property name="signtool.cmd" value="signtool"/>
<property name="nsis.cmd" value="makensis"/>
<taskdef
resource="net/sf/antcontrib/antcontrib.properties"
classpath="./ant-contrib-0.6.jar"/>
Expand Down Expand Up @@ -128,18 +126,18 @@
<echo message="=========="/>
<echo message="JAVA_HOME: ${JAVA_HOME}"/>
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="HAXE_HOME: ${HAXE_HOME}"/>
<echo message="HAXEPATH: ${HAXEPATH}"/>
<echo message="SIGNTOOL_HOME: ${SIGNTOOL_HOME}"/>
<echo message="NSIS_HOME: ${NSIS_HOME}"/>
<echo message="adt command: ${adt.cmd}"/>
<echo message="haxelib command: ${haxelib.cmd}"/>
<echo message="signtool command: ${signtool.cmd}"/>
<echo message="nsis command: ${nsis.cmd}"/>
</target>

<!-- ANCHOR - Init -->
<target name="init">
<mkdir dir="./bin"/>
<mkdir dir="./bin/app"/>

<java jar="${adt_path}" fork="true" failonerror="true">
<java jar="${adt.cmd}" fork="true" failonerror="true">
<arg line="-certificate" />
<arg line="-cn MoonshineSelfSignedCertificate" />
<arg line="2048-RSA" />
Expand Down Expand Up @@ -191,28 +189,28 @@

<!-- ANCHOR - Install Haxe Dependencies -->
<target name="install-haxe-dependencies">
<exec executable="${HAXEPATH}/haxelib"
<exec executable="${haxelib.cmd}"
dir="../../MoonshineSDKInstallerGUICore"
failonerror="true">
<arg value="install"/>
<arg value="feathersui"/>
<arg value="--quiet"/>
</exec>
<exec executable="${HAXEPATH}/haxelib"
<exec executable="${haxelib.cmd}"
dir="../../MoonshineSDKInstallerGUICore"
failonerror="true">
<arg value="install"/>
<arg value="openfl"/>
<arg value="--quiet"/>
</exec>
<exec executable="${HAXEPATH}/haxelib"
<exec executable="${haxelib.cmd}"
dir="../../MoonshineSDKInstallerGUICore"
failonerror="true">
<arg value="install"/>
<arg value="actuate"/>
<arg value="--quiet"/>
</exec>
<exec executable="${HAXEPATH}/haxelib"
<exec executable="${haxelib.cmd}"
dir="../../MoonshineSDKInstallerGUICore"
failonerror="true">
<arg value="install"/>
Expand All @@ -223,15 +221,15 @@
<echo message=""/>
<echo message="All Installed Haxelib Libraries:"/>
<echo message="=========="/>
<exec executable="${HAXEPATH}/haxelib">
<exec executable="${haxelib.cmd}">
<arg value="list"/>
</exec>

</target>

<!-- ANCHOR - Compile GUI Core -->
<target name="compile-gui-core">
<exec executable="${HAXEPATH}/haxelib"
<exec executable="${haxelib.cmd}"
dir="../../MoonshineSDKInstallerGUICore"
failonerror="true">
<arg value="run"/>
Expand Down Expand Up @@ -276,7 +274,7 @@

<!-- ANCHOR - Compile App -->
<target name="compile-app">
<java jar="${adt_path}" fork="true" failonerror="true">
<java jar="${adt.cmd}" fork="true" failonerror="true">
<arg line="-package" />
<arg line="-storetype pkcs12" />
<arg line="-keystore './bin/MoonshineSelfSignedCertificate.p12'" />
Expand Down Expand Up @@ -305,7 +303,7 @@

<!-- ANCHOR - Create Windows Installer -->
<target name="create-windows-installer">
<exec executable="${NSIS_HOME}/makensis.exe" failonerror="true">
<exec executable="${nsis.cmd}" failonerror="true">
<arg value="/DVERSION=${app.version}"/>
<arg value="/DINSTALLERNAME=${app.name}"/>
<arg value="/DEXECUTABLENAME=${app.name}"/>
Expand All @@ -318,7 +316,7 @@

<!-- ANCHOR - Sign Windows Installer -->
<target name="sign-windows-installer" if="${build.is.signed}">
<exec executable="${SIGNTOOL_HOME}/signtool.exe" failonerror="true">
<exec executable="${signtool.cmd}" failonerror="true">
<arg value="sign"/>
<arg value="/sha1"/>
<arg value="${env.SM_THUMBPRINT}"/>
Expand Down
13 changes: 8 additions & 5 deletions MoonshineSDKInstaller/build/local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ build.is.development=false
build.is.signed=true

# Build Tools Paths
# Env values used by default. Override only if needed.
# Env values used by default. Override only if needed. Use forward slashes for paths.

# JDK path (Overrides JAVA_HOME).
# JAVA_HOME=/path/to/java/sdk

# Flex SDK path (Overrides FLEX_HOME).
# FLEX_HOME=/path/to/flex/sdk

# Haxe toolkit path (Overrides HAXE_HOME).
# HAXE_HOME=/path/to/haxe/toolkit
# Haxelib command path
# haxelib.cmd=C:/HaxeToolkit/haxe/haxelib.exe

# Haxelib directory path (Overrides HAXEPATH).
# HAXEPATH=/path/to/haxelib
# Signtool command path
# signtool.cmd=C:/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x64/signtool.exe

# NSIS command path
# nsis.cmd=C:/Program Files (x86)/NSIS/makensis.exe

# Signing.
# IMPORTANT: Set as Environment Variables in you local system. Do not include in this file.
Expand Down

0 comments on commit 5453c4b

Please sign in to comment.