Skip to content

Commit

Permalink
ci: again
Browse files Browse the repository at this point in the history
  • Loading branch information
stevana committed Nov 4, 2024
1 parent 1f65d26 commit 661a27a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ jobs:
id: cache
env:
key: ${{ runner.os }}-ghc-${{ matrix.ghc-version }}-cabal-${{ matrix.cabal-version }}
paths: ${{ env.platform == 'x86_64-linux' &&
'~/.cache/cabal\n~/.cabal/store\ndist-newstyle' ||
steps.setup.outputs.cabal-store }}
with:
path: ${{ env.paths }}
# '~/.cache/cabal\n~/.cabal/store\ndist-newstyle' ||
path: ${{ env.platform == 'x86_64-linux' &&
'/home/runner/.cache/cabal/packages\n/home/runner/.cabal/store\ndist-newstyle' ||
steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-plan-

Expand Down Expand Up @@ -205,12 +205,10 @@ jobs:
- name: Save cached dependencies
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
env:
paths: ${{ env.platform == 'x86_64-linux' &&
'~/.cache/cabal\n~/.cabal/store\ndist-newstyle' ||
steps.setup.outputs.cabal-store }}
with:
path: ${{ env.paths }}
path: ${{ env.platform == 'x86_64-linux' &&
'/home/runner/.cache/cabal/packages\n/home/runner/.cabal/store\ndist-newstyle' ||
steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Build
Expand Down
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ SPEX_GIT_COMMIT ?= $(shell git rev-parse HEAD)
ifeq ($(findstring mingw64_nt,$(OS)),mingw64_nt)
SHELL := pwsh.exe
.SHELLFLAGS := -Command
SUFFIX := .exe
else
# This default file is used for simulating GitHub actions outputs locally:
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/passing-information-between-jobs
GITHUB_OUTPUT ?= "$(TEMPDIR)/spex_github_output"
# Make make fail if the shell commands fail.
.SHELLFLAGS = -ec
SUFFIX :=
endif

ifeq ($(GITHUB_ACTIONS),true)
Expand All @@ -37,7 +35,7 @@ endif
ifeq ($(OS),linux)
CABAL := docker run --rm --entrypoint=cabal \
--volume $(PWD):/mnt \
--volume $(HOME)/.cache/cabal:/root/.cache/cabal \
--volume $(HOME)/.cache/cabal/packages:/root/.cache/cabal/packages \
--volume $(HOME)/.cabal/store:/root/.local/state/cabal/store \
--volume $(PWD)/dist-newstyle:/mnt/dist-newstyle \
--env SPEX_GIT_COMMIT=$(SPEX_GIT_COMMIT) \
Expand Down Expand Up @@ -99,9 +97,15 @@ release:
ls -R $(SPEX_BIN)
for dir in $$(ls $(SPEX_BIN)); do \
for bin in $$(ls $(SPEX_BIN)/$$dir); do \
mv $(SPEX_BIN)/$$dir/$$bin \
$(SPEX_BIN)/$$(basename $$bin $(SUFFIX))-$(NEW_VERSION)-$$(basename $$dir)$(SUFFIX); \
chmod 755 $(SPEX_BIN)/$$(basename $$bin $(SUFFIX))-$(NEW_VERSION)-$$(basename $$dir)$(SUFFIX); \
if [ $${bin: -4} == ".exe" ]; do \
mv $(SPEX_BIN)/$$dir/$$bin \
$(SPEX_BIN)/$$(basename $$bin .exe)-$(NEW_VERSION)-$$(basename $$dir).exe; \
chmod 755 $(SPEX_BIN)/$$(basename $$bin .exe)-$(NEW_VERSION)-$$(basename $$dir).exe; \
else \
mv $(SPEX_BIN)/$$dir/$$bin \
$(SPEX_BIN)/$$(basename $$bin)-$(NEW_VERSION)-$$(basename $$dir); \
chmod 755 $(SPEX_BIN)/$$(basename $$bin)-$(NEW_VERSION)-$$(basename $$dir); \
fi
done \
done
upx -q $(SPEX_BIN)/spex*
Expand Down

0 comments on commit 661a27a

Please sign in to comment.