-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa3162a
commit 21d9633
Showing
11 changed files
with
313 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,11 +86,30 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: Get Cer for code signing | ||
if: runner.os == 'macOS' | ||
run: base64 -d <<< "$NOTARIZE_P8_BASE64" > /tmp/notary-key.p8 | ||
shell: bash | ||
env: | ||
NOTARIZE_P8_BASE64: ${{ secrets.NOTARIZE_P8_BASE64 }} | ||
|
||
- uses: apple-actions/import-codesign-certs@v2 | ||
continue-on-error: true | ||
if: runner.os == 'macOS' | ||
with: | ||
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }} | ||
p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }} | ||
|
||
- name: Install choco on Windows | ||
if: runner.os == 'Windows' | ||
run: | | ||
choco install make pkgconfiglite ccache awscli 7zip ninja -y | ||
- uses: actions/setup-dotnet@v3 | ||
if: runner.os == 'Windows' | ||
with: | ||
dotnet-version: "8.0.x" | ||
|
||
- name: Download ccache from s3 | ||
if: runner.os == 'Windows' | ||
continue-on-error: true | ||
|
@@ -117,7 +136,54 @@ jobs: | |
run: | | ||
cd engine | ||
make pre-package | ||
- name: Code Signing binaries | ||
run: | | ||
cd engine | ||
make codesign-binary CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }} AZURE_KEY_VAULT_URI="${{ secrets.AZURE_KEY_VAULT_URI }}" AZURE_CLIENT_ID="${{ secrets.AZURE_CLIENT_ID }}" AZURE_TENANT_ID="${{ secrets.AZURE_TENANT_ID }}" AZURE_CLIENT_SECRET="${{ secrets.AZURE_CLIENT_SECRET }}" AZURE_CERT_NAME="${{ secrets.AZURE_CERT_NAME }}" | ||
- name: Notary macOS Binary | ||
if: runner.os == 'macOS' | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sh -s -- -b /usr/local/bin | ||
cd engine/cortex | ||
# Notarize the binary | ||
quill notarize ./cortex | ||
env: | ||
QUILL_NOTARY_KEY_ID: ${{ secrets.NOTARY_KEY_ID }} | ||
QUILL_NOTARY_ISSUER: ${{ secrets.NOTARY_ISSUER }} | ||
QUILL_NOTARY_KEY: "/tmp/notary-key.p8" | ||
|
||
- name: Build Installers | ||
shell: bash | ||
run: | | ||
cd engine | ||
make build-installer PACKAGE_NAME=cortexcpp-nightly VERSION=${{ needs.get-update-version.outputs.new_version }} SOURCE_BINARY_PATH="../../cortex/cortex" DESTINATION_BINARY_NAME="cortex-nightly" DATA_FOLDER_NAME=".cortex-nightly" CONFIGURATION_FILE_NAME=".cortexrc-nightly" UNINSTALLER_FILE_NAME="cortex-nightly-uninstall.sh" | ||
- name: Codesign and notary for macos installer | ||
if: runner.os == 'macOS' | ||
run: | | ||
cd engine | ||
productsign --sign "Developer ID Installer: ${{ secrets.DEVELOPER_ID }}" cortexcpp-nightly-${{ needs.get-update-version.outputs.new_version }}.pkg cortexcpp-nightly-${{ needs.get-update-version.outputs.new_version }}-signed.pkg | ||
rm cortexcpp-nightly-${{ needs.get-update-version.outputs.new_version }}.pkg | ||
mv cortexcpp-nightly-${{ needs.get-update-version.outputs.new_version }}-signed.pkg cortexcpp-nightly-${{ needs.get-update-version.outputs.new_version }}.pkg | ||
xcrun notarytool submit cortexcpp-nightly-${{ needs.get-update-version.outputs.new_version }}.pkg --apple-id ${{ secrets.APPLE_ID }} --password ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} --team-id ${{ secrets.APPLE_TEAM_ID }} --wait | ||
- name: Compile .ISS to .EXE Installer | ||
uses: Minionguyjpro/[email protected] | ||
if: runner.os == 'Windows' | ||
with: | ||
path: engine/templates/windows/installer-nightly.iss | ||
options: /O+ | ||
|
||
- name: Codesign for windows installer | ||
if: runner.os == 'Windows' | ||
run: | | ||
cd engine | ||
dotnet tool install --global AzureSignTool | ||
set PATH=%PATH%;%USERPROFILE%\.dotnet\tools | ||
azuresigntool.exe sign -kvu ${{ secrets.AZURE_KEY_VAULT_URI }} -kvi ${{ secrets.AZURE_CLIENT_ID }} -kvt ${{ secrets.AZURE_TENANT_ID }} -kvs ${{ secrets.AZURE_CLIENT_SECRET }} -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\templates\windows\setup.exe";' | ||
- name: Package | ||
run: | | ||
cd engine | ||
|
@@ -129,6 +195,27 @@ jobs: | |
name: cortex-${{ matrix.os }}-${{ matrix.name }} | ||
path: ./engine/cortex | ||
|
||
- name: Upload windwos installer | ||
if: runner.os == 'Windows' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: cortex-${{ matrix.os }}-installer-${{ matrix.name }} | ||
path: ./engine/templates/windows/setup.exe | ||
|
||
- name: Upload macos installer | ||
if: runner.os == 'macOS' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: cortex-${{ matrix.os }}-installer-${{ matrix.name }} | ||
path: ./engine/cortexcpp-nightly.pkg | ||
|
||
- name: Upload linux installer | ||
if: runner.os == 'Linux' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: cortex-${{ matrix.os }}-installer-${{ matrix.name }} | ||
path: ./engine/cortexcpp-nightly.deb | ||
|
||
- name: Upload ccache to s3 | ||
continue-on-error: true | ||
if: always() && runner.os == 'Windows' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
#!/bin/sh | ||
echo "Running post-install script..." | ||
DESTINATION_BINARY_NAME=cortex | ||
echo "Download cortex.llamacpp engines by default" | ||
USER_TO_RUN_AS=${SUDO_USER:-$(whoami)} | ||
sudo -u "$USER_TO_RUN_AS" /usr/bin/$DESTINATION_BINARY_NAME engines cortex.llamacpp install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/sh | ||
set +e | ||
|
||
/usr/bin/cortex stop > /dev/null 2>&1 | ||
|
||
DESTINATION_BINARY_NAME=cortex | ||
USER_TO_RUN_AS=${SUDO_USER:-$(whoami)} | ||
sudo -u "$USER_TO_RUN_AS" /usr/bin/$DESTINATION_BINARY_NAME stop > /dev/null 2>&1 | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
PACKAGE_NAME=$1 | ||
VERSION=$2 | ||
SOURCE_BINARY_PATH=$3 | ||
DESTINATION_BINARY_NAME=$4 | ||
DATA_FOLDER_NAME=$5 | ||
CONFIGURATION_FILE_NAME=$6 | ||
UNINSTALLER_FILE_NAME=$7 | ||
|
||
mkdir installer | ||
mkdir scripts | ||
|
||
cp $SOURCE_BINARY_PATH installer/$DESTINATION_BINARY_NAME | ||
|
||
export DESTINATION_BINARY_NAME | ||
cp post-installer.sh scripts/post-installer.sh | ||
sed -i '2s/.*/DESTINATION_BINARY_NAME=\$DESTINATION_BINARY_NAME/' $PACKAGE_NAME/DEBIAN/postinst | ||
|
||
export DATA_FOLDER_NAME CONFIGURATION_FILE_NAME UNINSTALLER_FILE_NAME | ||
cp cortex-uninstall.sh scripts/$UNINSTALLER_FILE_NAME | ||
sed -i '2s/.*/DESTINATION_BINARY_NAME=\$DESTINATION_BINARY_NAME/' scripts/$UNINSTALLER_FILE_NAME | ||
sed -i '3s/.*/DATA_FOLDER_NAME=\$DATA_FOLDER_NAME/' scripts/$UNINSTALLER_FILE_NAME | ||
sed -i '4s/.*/CONFIGURATION_FILE_NAME=\$CONFIGURATION_FILE_NAME/' scripts/$UNINSTALLER_FILE_NAME | ||
sed -i '5s/.*/UNINSTALLER_FILE_NAME=\$UNINSTALLER_FILE_NAME/' scripts/$UNINSTALLER_FILE_NAME | ||
|
||
pkgbuild --identifier ai.cortexcpp.pkg --version $VERSION --scripts scripts --install-location /usr/local/bin --root ./installer ${PACKAGE_NAME}.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
DESTINATION_BINARY_NAME=cortex | ||
echo "Download cortex.llamacpp engines by default" | ||
USER_TO_RUN_AS=${SUDO_USER:-$(whoami)} | ||
sudo -u "$USER_TO_RUN_AS" /usr/local/bin/$DESTINATION_BINARY_NAME engines cortex.llamacpp install |
Oops, something went wrong.