From 8201343a9ad8330f3a38d5f33e1e60b5c3328867 Mon Sep 17 00:00:00 2001 From: Stevan Andjelkovic Date: Tue, 22 Oct 2024 17:31:52 +0200 Subject: [PATCH] ci: try to add compression --- .github/workflows/main.yaml | 16 +++++++++++++--- release/Dockerfile | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8613a15..5ef78af 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -120,9 +120,10 @@ jobs: ${HOME}/.cache/cabal/packages ${HOME}/.cabal/store key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} - restore-keys: ${{ env.key }}- - # ${{ github.workspace }}/dist-newstyle + #${{ github.workspace }}/dist-newstyle + #restore-keys: ${{ env.key }}-plan- + - name: Install dependencies # If we had an exact cache hit, the dependencies will be up to date. @@ -188,6 +189,14 @@ jobs: "${{ github.workspace }}/bin" ls -R "${{github.workspace }}/bin" || true + - name: Compress binaries + run: | + docker run \ + --volume "${{ github.workspace }}/bin":/mnt/ \ + --entrypoint=upx \ + ghcr.io/spex-lang/static-build:9.6.6 \ + --best -q /mnt/spex + - name: Create new git tag, if merge to main and .cabal version is bumped if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} uses: sol/haskell-autotag@v1 @@ -195,7 +204,8 @@ jobs: - name: Release run: | - gh release create --draft --notes-file=CHANGELOG.md "${{ github.workspace }}/bin/*" + gh release create --draft --notes-file=CHANGELOG.md \ + ${{ steps.autotag.outputs.version }} "${{ github.workspace }}/bin/*" # uses: softprops/action-gh-release@v2 # # if: steps.autotag.outputs.created # with: diff --git a/release/Dockerfile b/release/Dockerfile index e2c30bd..a9b92a1 100644 --- a/release/Dockerfile +++ b/release/Dockerfile @@ -94,6 +94,7 @@ RUN apk upgrade --no-cache \ libffi-dev \ musl-dev \ ncurses-dev \ + upx \ zlib-dev \ zlib-static \ && git config --global --add safe.directory /mnt