A peer-to-peer stack for code collaboration
Use packaging script for macOS packages
Thomas Scholtes6aa3d359784d
diff --git a/.circleci/config.yml b/.circleci/config.ymlindex db31efe..6d87dd7 100644--- a/.circleci/config.yml+++ b/.circleci/config.yml@@ -54,11 +54,8 @@ jobs:command: |brew install coreutilsecho 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> $BASH_ENV-- if [[ "$CIRCLE_BRANCH" == "master" ]]; then- brew tap caskroom/cask- brew cask install google-cloud-sdk- fi+ brew tap caskroom/cask+ brew cask install google-cloud-sdk- save_cache:key: homebrew-{{ epoch }}@@ -67,65 +64,43 @@ jobs:- restore_cache:keys:- - stack-root-v2-{{ arch }}-ghc8.6.3-{{ checksum "snapshot.yaml" }}-{{ checksum "package.yaml" }}- - stack-root-v2-{{ arch }}-ghc8.6.3-{{ checksum "snapshot.yaml" }}+ - stack-root-v3-pkg-1-{{ arch }}-ghc8.6.3-{{ checksum "snapshot.yaml" }}-{{ checksum "package.yaml" }}+ - stack-root-v3-pkg-1-{{ arch }}-ghc8.6.3-{{ checksum "snapshot.yaml" }}+ - stack-root-v3-pkg-1-{{ arch }}-ghc8.6.3-- stack-root-v2-{{ arch }}-ghc8.6.3-- - stack-root-{{ arch }}-ghc8.6.3-- run:name: Build Dependenciescommand: |- stack build --no-terminal --dependencies-only+ stack build \+ --no-terminal \+ --test \+ --dependencies-only+# Don’t want this files to be cached. They are large and# not neededrm -rf ~/.stack/indices/Hackage/00-index.tar*- save_cache:- key: stack-root-v2-{{ arch }}-ghc8.6.3-{{ checksum "snapshot.yaml" }}-{{ checksum "package.yaml" }}+ key: stack-root-v3-pkg-1-{{ arch }}-ghc8.6.3-{{ checksum "snapshot.yaml" }}-{{ checksum "package.yaml" }}paths:- "~/.stack"- run:- name: Build Executables+ name: Buildcommand: |- cabal v1-update- cabal v1-configure \- --prefix=/usr/local \- --docdir=/usr/local/share/doc/radicle \- --libsubdir=radicle \- --datasubdir=radicle \- --libexecsubdir=radicle \- --package-db="$(stack path --snapshot-pkg-db)" \- --package-db="$(stack path --local-pkg-db)" \- --package-db="$(stack path --global-pkg-db)"- cabal v1-build+ stack build \+ --no-terminal \+ --pedantic- run:name: Packagecommand: |- if [[ "$CIRCLE_BRANCH" == "master" ]]; then- cabal v1-copy \- exe:rad \- exe:radicle \- exe:rad-daemon-radicle \- exe:rad-machines \- --destdir=dist/package-root-- mkdir -p dist/pkg- tarball=radicle_${CIRCLE_SHA1}_x86_64-darwin.tar.gz- tar -C dist/package-root -cvzf dist/pkg/$tarball usr- sha512sum dist/pkg/$tarball|cut -d ' ' -f1 > dist/pkg/${tarball}.sha512- fi-- - run:- name: Upload to Google Cloud Storage- command: |- if [[ "$CIRCLE_BRANCH" == "master" ]]; then- # Key ID: db4e4a0b0ee696ea6f263c20de593c2fba4d0998- echo "$GCLOUD_SERVICE_KEY" | \- gcloud auth activate-service-account \- --key-file=--- gsutil -m cp dist/pkg/* gs://static.radicle.xyz/releases/- fi+ echo "$GCLOUD_SERVICE_KEY" | \+ gcloud auth activate-service-account \+ --key-file=-++ version="$(date +%Y.%m.%d)-$(git rev-parse --short HEAD)"+ VERSION=$version TARGET=darwin ./packaging/build-package.sh+ ./packaging/upload.shdiff --git a/packaging/build-package.sh b/packaging/build-package.shindex 1d5e220..8f8c929 100755--- a/packaging/build-package.sh+++ b/packaging/build-package.sh@@ -85,7 +85,9 @@ EOFmkdir -p "$package_root/$radpath"cp --archive $project_dir/rad -T "$package_root/$radpath"- get-ipfs "$package_root/$radicle_bindir"+ if [ $include_ipfs = 1 ]; then+ get-ipfs "$package_root/$radicle_bindir"+ fi}function package () {@@ -102,6 +104,7 @@ function package () {}function package-pacman () {+ prepare-package-rootpackage \--output-type pacman \--depends git \@@ -110,6 +113,8 @@ function package-pacman () {}function package-debian () {+ include_ipfs=1+ prepare-package-rootpackage \--output-type deb \--depends git \@@ -118,6 +123,12 @@ function package-debian () {--depends libncurses5}+function package-darwin () {+ tarball="$project_dir/packaging/out/radicle_${VERSION}_x86_64-darwin.tar.gz"+ prepare-package-root+ tar -czf "$tarball" -C "$package_root" .+}+if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; thenhelp@@ -141,12 +152,12 @@ fiset -x+include_ipfs=0project_dir=$(realpath "$(dirname $BASH_SOURCE)/..")radicle_bindir=/usr/lib/radicle/binradpath=/usr/lib/radicle/modulesstack_bin_install_dir=$(stack path --local-install-root)/binpackage_root=$(mktemp -td "radicle-package.XXXX")-prepare-package-rootpackage-$TARGETrm -rf "$package_root"