From bedea6ac1819d7dac45935a746633f6a2baaac66 Mon Sep 17 00:00:00 2001 From: Nicola <61830443+nicola02nb@users.noreply.github.com> Date: Thu, 17 Jul 2025 12:50:11 +0200 Subject: [PATCH 1/3] Added input `build-dependency-path` for go `cache-dependency-path` --- action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 1060d9a..da0113d 100644 --- a/action.yml +++ b/action.yml @@ -27,6 +27,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 @@ -162,7 +166,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' From 32326248f4b2d8ad5fccdd4f84faa528cb315520 Mon Sep 17 00:00:00 2001 From: Nicola <61830443+nicola02nb@users.noreply.github.com> Date: Fri, 22 Aug 2025 18:23:56 +0200 Subject: [PATCH 2/3] Adde upx compress --- action.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/action.yml b/action.yml index da0113d..d503de1 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 @@ -158,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 @@ -185,6 +199,19 @@ runs: shell: bash working-directory: ${{inputs.deno-working-directory}} run: ${{inputs.deno-build}} + # install upx + - name: Install UPX Linux + if: inputs.upx == 'true' && runner.os == 'Linux' + run: sudo apt-get -yq install upx + shell: bash + - name: Install UPX Windows + if: inputs.upx == 'true' && runner.os == 'Windows' + run: choco install upx + shell: bash + - name: Install UPX macOS + if: inputs.upx == 'true' && runner.os == 'macOS' + run: brew install upx + shell: bash # install wails - name: Install Wails if: inputs.build == 'true' && inputs.wails-dev-build == 'false' From 44e30d6cfa2d1f70e08cd5561604c76a475840a6 Mon Sep 17 00:00:00 2001 From: Nicola <61830443+nicola02nb@users.noreply.github.com> Date: Fri, 22 Aug 2025 18:25:30 +0200 Subject: [PATCH 3/3] Refactor UPX installation to use GitHub Action --- action.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/action.yml b/action.yml index d503de1..f726100 100644 --- a/action.yml +++ b/action.yml @@ -200,18 +200,11 @@ runs: working-directory: ${{inputs.deno-working-directory}} run: ${{inputs.deno-build}} # install upx - - name: Install UPX Linux - if: inputs.upx == 'true' && runner.os == 'Linux' - run: sudo apt-get -yq install upx - shell: bash - - name: Install UPX Windows - if: inputs.upx == 'true' && runner.os == 'Windows' - run: choco install upx - shell: bash - - name: Install UPX macOS - if: inputs.upx == 'true' && runner.os == 'macOS' - run: brew install upx - shell: bash + - 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'