From ac0e40da7eef43b99ae379e47b1ca5cbffce690a Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Tue, 23 May 2023 18:15:05 +0200 Subject: [PATCH 01/12] add scripts for pkg creation for mac --- release_files/darwin_pkg/postinstall | 31 +++++++++++++++++++++ release_files/darwin_pkg/preinstall | 6 ++++ release_files/darwin_pkg/requirements.plist | 11 ++++++++ 3 files changed, 48 insertions(+) create mode 100755 release_files/darwin_pkg/postinstall create mode 100755 release_files/darwin_pkg/preinstall create mode 100644 release_files/darwin_pkg/requirements.plist diff --git a/release_files/darwin_pkg/postinstall b/release_files/darwin_pkg/postinstall new file mode 100755 index 000000000..b87ef490e --- /dev/null +++ b/release_files/darwin_pkg/postinstall @@ -0,0 +1,31 @@ +#!/bin/sh + +APP=/Applications/NetBird.app +AGENT=/usr/local/bin/netbird + +{ + echo "Installing NetBird..." + + if test -d $APP; then + echo "NetBird app copied successfully." + else + echo "NetBird app could not be copied to the Applications folder." + exit 1 + fi + + ln -s $APP/netbird $AGENT + if test -f $AGENT; then + echo "NetBird binary linked successfully." + else + echo "NetBird could not create symlink to /usr/local/bin" + exit 1 + fi + + $AGENT service install + $AGENT service start + + open $APP + + echo "Finished Netbird installation successfully" + exit 0 # all good +} > /tmp/my_postinstall.log diff --git a/release_files/darwin_pkg/preinstall b/release_files/darwin_pkg/preinstall new file mode 100755 index 000000000..6e9c1d9f0 --- /dev/null +++ b/release_files/darwin_pkg/preinstall @@ -0,0 +1,6 @@ +#!/bin/sh + +{ + echo "Preinstall complete" + exit 0 # all good +} > /tmp/my_preinstall.log diff --git a/release_files/darwin_pkg/requirements.plist b/release_files/darwin_pkg/requirements.plist new file mode 100644 index 000000000..dd904f049 --- /dev/null +++ b/release_files/darwin_pkg/requirements.plist @@ -0,0 +1,11 @@ + + + + + arch + + x86_64 + arm64 + + + From 98eb2d458750b66d42c53499d951564581e8668a Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Thu, 25 May 2023 12:22:13 +0200 Subject: [PATCH 02/12] update log path --- release_files/darwin_pkg/postinstall | 3 ++- release_files/darwin_pkg/preinstall | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/release_files/darwin_pkg/postinstall b/release_files/darwin_pkg/postinstall index b87ef490e..3342de933 100755 --- a/release_files/darwin_pkg/postinstall +++ b/release_files/darwin_pkg/postinstall @@ -2,6 +2,7 @@ APP=/Applications/NetBird.app AGENT=/usr/local/bin/netbird +LOG_FILE=/var/log/netbird/client_install.log { echo "Installing NetBird..." @@ -28,4 +29,4 @@ AGENT=/usr/local/bin/netbird echo "Finished Netbird installation successfully" exit 0 # all good -} > /tmp/my_postinstall.log +} >> $LOG_FILE diff --git a/release_files/darwin_pkg/preinstall b/release_files/darwin_pkg/preinstall index 6e9c1d9f0..e730e277f 100755 --- a/release_files/darwin_pkg/preinstall +++ b/release_files/darwin_pkg/preinstall @@ -1,6 +1,8 @@ #!/bin/sh +LOG_FILE=/var/log/netbird/client_install.log + { echo "Preinstall complete" exit 0 # all good -} > /tmp/my_preinstall.log +} > $LOG_FILE From 4e69af6caa6aa251f439b7cb92cfb0b6109f485a Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Thu, 25 May 2023 14:40:32 +0200 Subject: [PATCH 03/12] also write error messages --- release_files/darwin_pkg/postinstall | 2 +- release_files/darwin_pkg/preinstall | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/release_files/darwin_pkg/postinstall b/release_files/darwin_pkg/postinstall index 3342de933..abe9e73fa 100755 --- a/release_files/darwin_pkg/postinstall +++ b/release_files/darwin_pkg/postinstall @@ -29,4 +29,4 @@ LOG_FILE=/var/log/netbird/client_install.log echo "Finished Netbird installation successfully" exit 0 # all good -} >> $LOG_FILE +} &>> $LOG_FILE diff --git a/release_files/darwin_pkg/preinstall b/release_files/darwin_pkg/preinstall index e730e277f..dc630afd4 100755 --- a/release_files/darwin_pkg/preinstall +++ b/release_files/darwin_pkg/preinstall @@ -5,4 +5,4 @@ LOG_FILE=/var/log/netbird/client_install.log { echo "Preinstall complete" exit 0 # all good -} > $LOG_FILE +} &> $LOG_FILE From 76004bd537fcb40eab0b766b4f0e477a3395d6cd Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Thu, 25 May 2023 14:54:48 +0200 Subject: [PATCH 04/12] update requirements.plist --- release_files/darwin_pkg/requirements.plist | 36 ++++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/release_files/darwin_pkg/requirements.plist b/release_files/darwin_pkg/requirements.plist index dd904f049..b6c2022c8 100644 --- a/release_files/darwin_pkg/requirements.plist +++ b/release_files/darwin_pkg/requirements.plist @@ -2,10 +2,36 @@ - arch - - x86_64 - arm64 - + items + + + assets + + + kind + software-package + url + netbird_x86_64.pkg + + + kind + software-package + url + netbird_arm64.pkg + + + metadata + + bundle-identifier + io.netbird.client + bundle-version + 0.20.3 + kind + software + title + NetBird + + + From fb3fbc17f2409323cb237cac453cfbea320c0010 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Thu, 25 May 2023 15:13:38 +0200 Subject: [PATCH 05/12] update requirements.plist --- release_files/darwin_pkg/requirements.plist | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/release_files/darwin_pkg/requirements.plist b/release_files/darwin_pkg/requirements.plist index b6c2022c8..58582cafe 100644 --- a/release_files/darwin_pkg/requirements.plist +++ b/release_files/darwin_pkg/requirements.plist @@ -2,6 +2,15 @@ + CFBundleSupportedPlatforms + + MacOSX + + LSArchitecturePriority + + x86_64 + arm64 + items From 4026efcc0841a4a7c82e6785688c7c6f35a6e5e9 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Thu, 25 May 2023 21:02:49 +0200 Subject: [PATCH 06/12] revert requirements.plist --- release_files/darwin_pkg/requirements.plist | 45 +++------------------ 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/release_files/darwin_pkg/requirements.plist b/release_files/darwin_pkg/requirements.plist index 58582cafe..dd904f049 100644 --- a/release_files/darwin_pkg/requirements.plist +++ b/release_files/darwin_pkg/requirements.plist @@ -2,45 +2,10 @@ - CFBundleSupportedPlatforms - - MacOSX - - LSArchitecturePriority - - x86_64 - arm64 - - items - - - assets - - - kind - software-package - url - netbird_x86_64.pkg - - - kind - software-package - url - netbird_arm64.pkg - - - metadata - - bundle-identifier - io.netbird.client - bundle-version - 0.20.3 - kind - software - title - NetBird - - - + arch + + x86_64 + arm64 + From b3027603df7ea89a19420158e666b5facc558554 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Thu, 25 May 2023 21:14:44 +0200 Subject: [PATCH 07/12] update postinstall --- release_files/darwin_pkg/postinstall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_files/darwin_pkg/postinstall b/release_files/darwin_pkg/postinstall index abe9e73fa..39a18fa4d 100755 --- a/release_files/darwin_pkg/postinstall +++ b/release_files/darwin_pkg/postinstall @@ -14,7 +14,7 @@ LOG_FILE=/var/log/netbird/client_install.log exit 1 fi - ln -s $APP/netbird $AGENT + ln -s $APP/Contents/MacOS/netbird $AGENT if test -f $AGENT; then echo "NetBird binary linked successfully." else From 4eec29a6393ed05cbdd6d98020cd517bfc26b064 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Thu, 25 May 2023 21:22:26 +0200 Subject: [PATCH 08/12] revert log writing --- release_files/darwin_pkg/postinstall | 41 ++++++++++++++-------------- release_files/darwin_pkg/preinstall | 8 +++--- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/release_files/darwin_pkg/postinstall b/release_files/darwin_pkg/postinstall index 39a18fa4d..a7bb95c0f 100755 --- a/release_files/darwin_pkg/postinstall +++ b/release_files/darwin_pkg/postinstall @@ -4,29 +4,28 @@ APP=/Applications/NetBird.app AGENT=/usr/local/bin/netbird LOG_FILE=/var/log/netbird/client_install.log -{ - echo "Installing NetBird..." - if test -d $APP; then - echo "NetBird app copied successfully." - else - echo "NetBird app could not be copied to the Applications folder." - exit 1 - fi +echo "Installing NetBird..." &>> $LOG_FILE - ln -s $APP/Contents/MacOS/netbird $AGENT - if test -f $AGENT; then - echo "NetBird binary linked successfully." - else - echo "NetBird could not create symlink to /usr/local/bin" - exit 1 - fi +if test -d $APP; then + echo "NetBird app copied successfully." &>> $LOG_FILE +else + echo "NetBird app could not be copied to the Applications folder." &>> $LOG_FILE + exit 1 +fi - $AGENT service install - $AGENT service start +ln -s $APP/Contents/MacOS/netbird $AGENT +if test -f $AGENT; then + echo "NetBird binary linked successfully." &>> $LOG_FILE +else + echo "NetBird could not create symlink to /usr/local/bin" &>> $LOG_FILE + exit 1 +fi - open $APP +$AGENT service install +$AGENT service start - echo "Finished Netbird installation successfully" - exit 0 # all good -} &>> $LOG_FILE +open $APP + +echo "Finished Netbird installation successfully" &>> $LOG_FILE +exit 0 # all good diff --git a/release_files/darwin_pkg/preinstall b/release_files/darwin_pkg/preinstall index dc630afd4..6c891a37c 100755 --- a/release_files/darwin_pkg/preinstall +++ b/release_files/darwin_pkg/preinstall @@ -2,7 +2,7 @@ LOG_FILE=/var/log/netbird/client_install.log -{ - echo "Preinstall complete" - exit 0 # all good -} &> $LOG_FILE +echo "Start installation..." &> $LOG_FILE +echo "Preinstall complete" &>> $LOG_FILE +exit 0 # all good + From 489be203fc1ea51345cbc1fa69a7b0489df33a2f Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Fri, 26 May 2023 13:07:14 +0200 Subject: [PATCH 09/12] revert logs writing --- release_files/darwin_pkg/postinstall | 41 ++++++++++++++-------------- release_files/darwin_pkg/preinstall | 8 +++--- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/release_files/darwin_pkg/postinstall b/release_files/darwin_pkg/postinstall index a7bb95c0f..39a18fa4d 100755 --- a/release_files/darwin_pkg/postinstall +++ b/release_files/darwin_pkg/postinstall @@ -4,28 +4,29 @@ APP=/Applications/NetBird.app AGENT=/usr/local/bin/netbird LOG_FILE=/var/log/netbird/client_install.log +{ + echo "Installing NetBird..." -echo "Installing NetBird..." &>> $LOG_FILE + if test -d $APP; then + echo "NetBird app copied successfully." + else + echo "NetBird app could not be copied to the Applications folder." + exit 1 + fi -if test -d $APP; then - echo "NetBird app copied successfully." &>> $LOG_FILE -else - echo "NetBird app could not be copied to the Applications folder." &>> $LOG_FILE - exit 1 -fi + ln -s $APP/Contents/MacOS/netbird $AGENT + if test -f $AGENT; then + echo "NetBird binary linked successfully." + else + echo "NetBird could not create symlink to /usr/local/bin" + exit 1 + fi -ln -s $APP/Contents/MacOS/netbird $AGENT -if test -f $AGENT; then - echo "NetBird binary linked successfully." &>> $LOG_FILE -else - echo "NetBird could not create symlink to /usr/local/bin" &>> $LOG_FILE - exit 1 -fi + $AGENT service install + $AGENT service start -$AGENT service install -$AGENT service start + open $APP -open $APP - -echo "Finished Netbird installation successfully" &>> $LOG_FILE -exit 0 # all good + echo "Finished Netbird installation successfully" + exit 0 # all good +} &>> $LOG_FILE diff --git a/release_files/darwin_pkg/preinstall b/release_files/darwin_pkg/preinstall index 6c891a37c..dc630afd4 100755 --- a/release_files/darwin_pkg/preinstall +++ b/release_files/darwin_pkg/preinstall @@ -2,7 +2,7 @@ LOG_FILE=/var/log/netbird/client_install.log -echo "Start installation..." &> $LOG_FILE -echo "Preinstall complete" &>> $LOG_FILE -exit 0 # all good - +{ + echo "Preinstall complete" + exit 0 # all good +} &> $LOG_FILE From 5d459cf11812b68b22e2e38524b5aefc8041c5ff Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Fri, 26 May 2023 13:10:01 +0200 Subject: [PATCH 10/12] remove requirements.plist --- release_files/darwin_pkg/requirements.plist | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 release_files/darwin_pkg/requirements.plist diff --git a/release_files/darwin_pkg/requirements.plist b/release_files/darwin_pkg/requirements.plist deleted file mode 100644 index dd904f049..000000000 --- a/release_files/darwin_pkg/requirements.plist +++ /dev/null @@ -1,11 +0,0 @@ - - - - - arch - - x86_64 - arm64 - - - From 8124a273fbe3e8e68ce378314588a56831819525 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Fri, 26 May 2023 13:56:01 +0200 Subject: [PATCH 11/12] fix log writing --- release_files/darwin_pkg/postinstall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_files/darwin_pkg/postinstall b/release_files/darwin_pkg/postinstall index 39a18fa4d..ad5036130 100755 --- a/release_files/darwin_pkg/postinstall +++ b/release_files/darwin_pkg/postinstall @@ -29,4 +29,4 @@ LOG_FILE=/var/log/netbird/client_install.log echo "Finished Netbird installation successfully" exit 0 # all good -} &>> $LOG_FILE +} &> $LOG_FILE From 2808647be7e7590ae0215e0c38e5c39729f80b32 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Fri, 26 May 2023 17:06:47 +0200 Subject: [PATCH 12/12] upgrade sign pipeline version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9db5a9072..ac03d4456 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ on: pull_request: env: - SIGN_PIPE_VER: "v0.0.6" + SIGN_PIPE_VER: "v0.0.7" GORELEASER_VER: "v1.14.1" concurrency: