Skip to content

Prepare to distribute codd as a macOS app bundle #454

Prepare to distribute codd as a macOS app bundle

Prepare to distribute codd as a macOS app bundle #454

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
defaults:
run:
shell: bash # Implies `set -eo pipefail`, among other things. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
env:
CI: 1
jobs:
build-aarch64-darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Recover disk space
run: |
df -h
ls /Applications
brew uninstall google-chrome
sudo rm -rf /Users/runner/Library/Android
sudo rm -rf /Applications/Xcode*
sudo rm -rf /Applications/Python*
ls /Applications
df -h
- uses: cachix/install-nix-action@v24
with:
install_url: https://releases.nixos.org/nix/nix-2.8.1/install
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
substituters = https://cache.nixos.org https://mzabani.cachix.org https://cache.iog.io
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= mzabani.cachix.org-1:wnkKakfl+rbT7zTtV1P1tAtjBTuh6GQVX7LfSd9sMbA= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
- uses: cachix/cachix-action@v12
with:
name: mzabani
skipPush: false
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
- name: Disk space
run: df -h
# - name: Simpler static build
# run: |
# # This should work according to https://github.com/NixOS/nixpkgs/pull/235990
# nix build -o static-hello nixpkgs#legacyPackages.aarch64-darwin.pkgsStatic.hello
# ./static-hello/bin/hello
# otool -L ./static-hello/bin/hello
# - name: Some haskell package's static build
# run: |
# nix build -o static-shellcheck nixpkgs#legacyPackages.aarch64-darwin.pkgsStatic.shellcheck
# ./static-shellcheck-bin/bin/shellcheck
# otool -L ./static-shellcheck-bin/bin/shellcheck
# - name: Build executable used for installer
# run: nix-build -o codd ./nix/install-codd-nixpkgs.nix -A codd
# - name: Check which libs the executable is linked against
# run: otool -L codd/bin/codd
- name: Build codd without static linking
run: nix build -o static-codd ".#codd:exe:codd"
- name: Check which libs the executable is linked against part 2
run: otool -L static-codd/bin/codd
- name: Create darwin bundle
run: |
nix-env -iA dylibbundler
dylibbundler -od -b -x ./static-codd/bin/codd -d ./codd-bundle/
ls codd-bundle -R
- name: Install codd with nix-env and uninstall it
run: |
nix-env -f ./nix/install-codd-nixpkgs.nix -iA codd
codd --help
nix-env --uninstall codd