Skip to content

Commit

Permalink
Bump actions versions in CI, cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Nov 20, 2023
1 parent d143ac4 commit 0cdb6fa
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 92 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/mac-bundle-dylib.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh
# Bundle icu4c DLLs

# see if icu4c has been installed
# see if icu4c has been installed
if [ "$(brew list | grep icu4c)" = "" ]
then
echo "installing icu4c"
echo "installing icu4c"
brew install icu4c
fi

Expand All @@ -14,12 +14,12 @@ dylib_dir=$(dirname "$(brew list icu4c | grep icuuc.dylib)")
# find the path of "als"
executable=$(find "$(stack path --local-install-root)"/bin -name "als")

# remove the old dylib, and make a new one
# remove the old dylib, and make a new one
rm -rf dylib
mkdir dylib
mkdir dylib

################################################################################
# icuuc
# icuuc
################################################################################

icuuc_id=$(otool -L "$executable" | grep icuuc | awk '{print $1}')
Expand All @@ -33,7 +33,7 @@ icuuc_id_new=@loader_path/dylib/$icuuc_id_basename
cp "$icuuc_path" "$icuuc_path_new"

# change icuuc's ID referenced by ALS
install_name_tool -change "$icuuc_id" "$icuuc_id_new" "$executable"
install_name_tool -change "$icuuc_id" "$icuuc_id_new" "$executable"

echo "icuuc referenced by ALS"
echo " old ID : $icuuc_id"
Expand All @@ -42,7 +42,7 @@ echo " old path: $icuuc_path"
echo " new path: $icuuc_path_new"

################################################################################
# icui18n
# icui18n
################################################################################

icui18n_id=$(otool -L "$executable" | grep icui18n | awk '{print $1}')
Expand All @@ -56,7 +56,7 @@ icui18n_id_new=@loader_path/dylib/$icui18n_id_basename
cp "$icui18n_path" "$icui18n_path_new"

# change icui18n's ID referenced by ALS
install_name_tool -change "$icui18n_id" "$icui18n_id_new" "$executable"
install_name_tool -change "$icui18n_id" "$icui18n_id_new" "$executable"

echo "icui18n referenced by ALS"
echo " old ID : $icui18n_id"
Expand All @@ -65,7 +65,7 @@ echo " old path: $icui18n_path"
echo " new path: $icui18n_path_new"

################################################################################
# icudata
# icudata
################################################################################

# otool -L "$icui18n_id" | grep icudata | awk '{print $1}'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-latest
steps:

- name: 📥 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: 🏭 Create Release
id: create_release
Expand All @@ -31,9 +32,8 @@ jobs:
release_name: ${{ github.ref }}
draft: false
prerelease: false
# - name: ⏫ Upload to Hackage
# id: upload_hackage
# - name: ⏫ Upload to Hackage
# id: upload_hackage
# env:
# HACKAGE_API_KEY: ${{ secrets.HACKAGE_API_KEY }}
# uses: freckle/stack-upload-action@main

52 changes: 24 additions & 28 deletions .github/workflows/test-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,35 @@ jobs:
steps:

- name: 📥 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# things to be cached/restored:

- name: 💾 Cache stack global package db
id: stack-global
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
key: ${{ runner.os }}-stack-global-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-${{ matrix.plan.ghc }}
${{ runner.os }}-stack-global
- name: 💾 Cache stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
key: ${{ runner.os }}-stack-programs-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-programs-${{ matrix.plan.ghc }}
${{ runner.os }}-stack-programs
- name: 💾 Cache .stack-work
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work-${{ matrix.plan.ghc }}
- name: 💾 Cache agda-language-server/.stack-work
uses: actions/cache@v2
with:
path: agda-language-server/.stack-work
key: ${{ runner.os }}-agda-language-server-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('agda-language-server/package.yaml') }}
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-agda-language-server-stack-work-${{ matrix.plan.ghc }}
${{ runner.os }}-stack-work
# actions:
Expand All @@ -55,6 +50,7 @@ jobs:
# curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
stack --version
- name: ⏬ Install GHC
run: |
df -h
Expand All @@ -73,20 +69,20 @@ jobs:
id: zip
run: |
# 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")
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/data
cp $executable zip/
cp -r "$datadir" zip/data
cp "$executable" zip/
# compress
cd zip
zip -r als-ubuntu.zip *
cd ..
cd zip
zip -r als-ubuntu.zip ./*
cd ..
mv zip/als-ubuntu.zip .
Expand All @@ -98,4 +94,4 @@ jobs:
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 changes: 27 additions & 33 deletions .github/workflows/test-mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,42 @@ jobs:
steps:

- name: 📥 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# things to be cached/restored:

- name: 💾 Cache stack global package db
id: stack-global
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-after20210110-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-after202110110
- name: 💾 Cache stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-programs
- name: 💾 Cache .stack-work
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work
- name: 💾 Cache agda-language-server/.stack-work
uses: actions/cache@v2
with:
path: agda-language-server/.stack-work
key: ${{ runner.os }}-agda-language-server-stack-work-${{ hashFiles('agda-language-server/package.yaml') }}
restore-keys: |
${{ runner.os }}-agda-language-server-stack-work
# actions:

- name: ⏬ Install stack
run: |
mkdir -p ~/.local/bin
export PATH=~/.local/bin:$PATH
export PATH=~/.local/bin:$PATH
# brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
if [[ ! -x ~/.local/bin/stack ]]; then brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
stack --version
Expand All @@ -71,10 +65,10 @@ jobs:
- name: 🔗 Bundle ICU4C DLLs
run: | # Bundle icu4c DLLs
# see if icu4c has been installed
# see if icu4c has been installed
if [ "$(brew list | grep icu4c)" = "" ]
then
echo "installing icu4c"
echo "installing icu4c"
brew install icu4c
fi
Expand All @@ -84,12 +78,12 @@ jobs:
# find the path of "als"
executable=$(find "$(stack path --local-install-root)"/bin -name "als")
# remove the old dylib, and make a new one
# remove the old dylib, and make a new one
rm -rf dylib
mkdir dylib
mkdir dylib
################################################################################
# icuuc
# icuuc
################################################################################
icuuc_id=$(otool -L "$executable" | grep icuuc | awk '{print $1}')
Expand All @@ -103,7 +97,7 @@ jobs:
cp "$icuuc_path" "$icuuc_path_new"
# change icuuc's ID referenced by ALS
install_name_tool -change "$icuuc_id" "$icuuc_id_new" "$executable"
install_name_tool -change "$icuuc_id" "$icuuc_id_new" "$executable"
echo "icuuc referenced by ALS"
echo " old ID : $icuuc_id"
Expand All @@ -112,7 +106,7 @@ jobs:
echo " new path: $icuuc_path_new"
################################################################################
# icui18n
# icui18n
################################################################################
icui18n_id=$(otool -L "$executable" | grep icui18n | awk '{print $1}')
Expand All @@ -126,7 +120,7 @@ jobs:
cp "$icui18n_path" "$icui18n_path_new"
# change icui18n's ID referenced by ALS
install_name_tool -change "$icui18n_id" "$icui18n_id_new" "$executable"
install_name_tool -change "$icui18n_id" "$icui18n_id_new" "$executable"
echo "icui18n referenced by ALS"
echo " old ID : $icui18n_id"
Expand All @@ -135,7 +129,7 @@ jobs:
echo " new path: $icui18n_path_new"
################################################################################
# icudata
# icudata
################################################################################
# otool -L "$icui18n_id" | grep icudata | awk '{print $1}'
Expand All @@ -160,21 +154,21 @@ jobs:
id: zip
run: |
# 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")
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/data
cp -r "$datadir" zip/data
cp -r dylib zip/dylib
cp $executable zip/
cp "$executable" zip/
# compress
cd zip
zip -r als-macos.zip *
cd ..
cd zip
zip -r als-macos.zip ./*
cd ..
mv zip/als-macos.zip .
- name: 🚢 Release Artifacts
Expand All @@ -185,4 +179,4 @@ jobs:
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 0cdb6fa

Please sign in to comment.