diff --git a/action.yml b/action.yml index 1060d9a..f726100 100644 --- a/action.yml +++ b/action.yml @@ -20,6 +20,14 @@ inputs: description: "Build a Windows Installer" required: false default: "false" + upx: + description: "Compress the build using upx, the Ultimate Packer for eXecutables." + required: false + default: "false" + upx-flags: + description: "Flags to pass to upx compress tool" + required: false + default: "" build-name: description: "The name of the binary file" required: true @@ -27,6 +35,10 @@ inputs: description: "Cache the build" required: false default: "true" + build-dependency-path: + description: "Used to specify the path to a dependency file - go.sum" + required: false + default: "go.sum" build-platform: description: "Platform to build for" required: false @@ -154,6 +166,12 @@ runs: if ${{ inputs.nsis == 'true' }}; then build_options+=' -nsis' fi + if ${{ inputs.upx == 'true' }}; then + build_options+=' -upx' + if [[ "${{ inputs.upx-flags }}" != "" ]]; then + build_options+=" -upxflags='${{ inputs.upx-flags }}'" + fi + fi echo "BUILD_OPTIONS=$build_options" >> "$GITHUB_OUTPUT" # Setup and configure GoLang - name: Setup GoLang @@ -162,7 +180,7 @@ runs: with: check-latest: true cache: ${{ inputs.build-cache }} - cache-dependency-path: 'go.sum' + cache-dependency-path: ${{ inputs.build-dependency-path }} go-version: ${{ inputs.go-version }} - name: Install Garble if: inputs.build-obfuscate == 'true' @@ -181,6 +199,12 @@ runs: shell: bash working-directory: ${{inputs.deno-working-directory}} run: ${{inputs.deno-build}} + # install upx + - name: Install UPX + if: inputs.upx == 'true' + uses: crazy-max/ghaction-upx@v3 + with: + install-only: true # install wails - name: Install Wails if: inputs.build == 'true' && inputs.wails-dev-build == 'false'