Skip to content

Commit

Permalink
strip executables & upx windows exe
Browse files Browse the repository at this point in the history
  • Loading branch information
rniii committed Aug 17, 2024
1 parent a2af791 commit ea7f15b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,25 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: '9.4.8'
cabal-version: '3.10'

- name: Install dependencies
if: runner.os == 'Windows'
run: |
scoop install main/upx
- name: Build
run: |
cabal update
cabal configure --enable-optimization=2 --enable-executable-static --enable-executable-stripping
cabal build --enable-static
cabal configure \
--enable-optimization=2 \
--enable-static --enable-executable-static \
--enable-executable-stripping
cabal build
echo "binpath=$(cabal list-bin maid)" >> $GITHUB_ENV
- name: Publish
if: runner.os == 'Linux'
run: |
pkg=maid-$("$binpath" -q version)
dstdir=$pkg "$binpath" install
strip "$pkg/bin/maid"
tar --remove-files -cf "$pkg.tar.gz" "$pkg"
gh release upload "$GITHUB_REF_NAME" "$pkg.tar.gz"
Expand All @@ -52,6 +55,7 @@ jobs:
run: |
exe=maid-$("$binpath" -q version).exe
cp "$binpath" "$exe"
strip "$exe" && upx "$exe"
gh release upload "$GITHUB_REF_NAME" "$exe"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit ea7f15b

Please sign in to comment.