From 1f45d882a4669b2bd38e435c5cdbf3f34699cd32 Mon Sep 17 00:00:00 2001 From: Ting-Gian LUA Date: Sun, 29 Aug 2021 17:38:46 +0800 Subject: [PATCH] [ change ][ ci ] Gather & compress executable with data files --- .github/workflows/test-linux.yaml | 33 +++++++++++++++++-------------- .github/workflows/test-mac.yaml | 33 ++++++++++++++++--------------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test-linux.yaml b/.github/workflows/test-linux.yaml index c0d810a..2daf6e3 100644 --- a/.github/workflows/test-linux.yaml +++ b/.github/workflows/test-linux.yaml @@ -61,7 +61,7 @@ jobs: stack setup --install-ghc df -h - - name: ⏬ Install haskell deps + - name: ⏬ Install dependencies run: | stack build --only-dependencies @@ -69,23 +69,26 @@ jobs: run: | stack test - # artifacts: - - - - name: 📦 Install - id: install - run: | - stack install - - name: 📦 Compress files id: zip run: | - mkdir als - cp ~/.local/bin/als als/ - find $(stack path --snapshot-install-root)/share -type d -name "Agda-*" - cp -r $(find $(stack path --snapshot-install-root)/share -type d -name "Agda-*") als/data - zip -r als als - mv als.zip als-ubuntu.zip + # locate the data-dir + datadir=$(find $(stack path --snapshot-install-root)/share -type d -name "Agda-*") + + # locate the executable + executable=$(find $(stack path --local-install-root)/bin -name "als") + + # make a temporary directory for compresssing + mkdir zip + cp -r $datadir zip/ + cp $executable zip/ + + # compress + cd zip + zip -r als-ubuntu.zip * + cd .. + mv zip/als-ubuntu.zip . + - name: 🚢 Release Artifacts uses: softprops/action-gh-release@v1 diff --git a/.github/workflows/test-mac.yaml b/.github/workflows/test-mac.yaml index 19cf063..d0c4a41 100644 --- a/.github/workflows/test-mac.yaml +++ b/.github/workflows/test-mac.yaml @@ -59,11 +59,7 @@ jobs: run: | stack setup --install-ghc - - name: 📦 Specify `Agda_datadir` - run: | - export Agda_datadir=$PWD/data - - - name: ⏬ Install haskell deps + - name: ⏬ Install dependencies run: | stack build --only-dependencies @@ -71,20 +67,25 @@ jobs: run: | stack test - - name: 📦 Install - id: install - run: | - stack install - - name: 📦 Compress files id: zip run: | - mkdir als - cp ~/.local/bin/als als/ - find $(stack path --snapshot-install-root)/share -type d -name "Agda-*" - cp -r $(find $(stack path --snapshot-install-root)/share -type d -name "Agda-*") als/data - zip -r als als - mv als.zip als-macos.zip + # locate the data-dir + datadir=$(find $(stack path --snapshot-install-root)/share -type d -name "Agda-*") + + # locate the executable + executable=$(find $(stack path --local-install-root)/bin -name "als") + + # make a temporary directory for compresssing + mkdir zip + cp -r $datadir zip/ + cp $executable zip/ + + # compress + cd zip + zip -r als-macos.zip * + cd .. + mv zip/als-macos.zip . - name: 🚢 Release Artifacts uses: softprops/action-gh-release@v1