Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 8125c6a

Browse files
authored
Feat cortex publish launchpad (#910)
Co-authored-by: Hien To <tominhhien97@gmail.com>
1 parent 28f416d commit 8125c6a

File tree

6 files changed

+115
-1
lines changed

6 files changed

+115
-1
lines changed

.github/workflows/cortex-build.yml

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI Cortex Release
22

33
on:
44
push:
5-
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
5+
tags: ["v[0-9]+.[0-9]+.[0-9]+", "v[0-9]+.[0-9]+.[0-9]+-*"]
66
paths: ["cortex-cpp/**", "cortex-js/**"]
77
workflow_dispatch:
88

@@ -416,6 +416,14 @@ jobs:
416416
asset_path: ./cortex-js/cortexso.deb
417417
asset_name: cortex-installer-${{ needs.create-draft-release.outputs.version }}-${{ matrix.name }}-${{ matrix.os }}.deb
418418
asset_content_type: application/gzip
419+
420+
# Upload artifact for package manager
421+
- name: Upload Artifact
422+
if: runner.os == 'Linux'
423+
uses: actions/upload-artifact@v2
424+
with:
425+
name: cortex-linux
426+
path: ./cortex-js/cortex
419427

420428
update_release_draft:
421429
needs: [build-and-test, build-cortex-single-binary]
@@ -440,3 +448,59 @@ jobs:
440448
# disable-autolabeler: true
441449
env:
442450
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
451+
452+
453+
# Add jobs with approval
454+
public_package_manager:
455+
needs: [create-draft-release, update_release_draft]
456+
runs-on: ubuntu-latest
457+
environment: package-manager
458+
permissions:
459+
contents: read
460+
steps:
461+
- name: checkout
462+
uses: actions/checkout@v4
463+
464+
- name: Download artifact
465+
uses: actions/download-artifact@v2
466+
with:
467+
name: cortex-linux
468+
path: ./cortex-linux
469+
470+
- name: install dependencies
471+
run: |
472+
ls -al ./cortex-linux
473+
sudo apt-get install dput devscripts build-essential debhelper-compat pbuilder debootstrap devscripts -y
474+
475+
- name: import gpg key with subkey
476+
uses: crazy-max/ghaction-import-gpg@v4
477+
with:
478+
gpg_private_key: ${{ secrets.HOMEBREW_GPG_PRIVATE_KEY }}
479+
passphrase: ${{ secrets.HOMEBREW_GPG_PASSPHRASE }}
480+
fingerprint: ${{ secrets.HOMEBREW_GPG_FINGERPRINT }}
481+
482+
- run: |
483+
mkdir -p package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian
484+
cp package-managers-template/launchpad/cortexso/debian/* package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian/
485+
cp ./cortex-linux/cortex package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/
486+
487+
- name: Get release notes
488+
id: release_notes
489+
run: |
490+
RELEASE_NOTES=$(curl -s -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/tags/${VERSION} | jq -r '.body')
491+
echo "RELEASE_NOTES=${RELEASE_NOTES}" >> $GITHUB_ENV
492+
- name: Update change log
493+
run: |
494+
sed -i "s/VERSION/${{ needs.create-draft-release.outputs.version }}/g" package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian/changelog
495+
sed -i "s/CHANGELOG_HERE/${{ env.RELEASE_NOTES }}/g" package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian/changelog
496+
timestamp=$(date -u +"%a, %d %b %Y %H:%M:%S +0000")
497+
sed -i "s/TIME_HERE/${timestamp}/g" package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian/changelog
498+
499+
- name: Build package
500+
run: |
501+
cd package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}
502+
echo "y" | debuild -S -sa -k${{ secrets.HOMEBREW_GPG_FINGERPRINT }}
503+
sudo pbuilder create --distribution jammy --debootstrapopts --variant=buildd
504+
sudo sudo pbuilder build ../cortexso_${{ needs.create-draft-release.outputs.version }}.dsc
505+
dput ppa:cortexlabs/cortex cortexso_${{ needs.create-draft-release.outputs.version }}_source.changes
506+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cortexso (VERSION) jammy; urgency=low
2+
3+
CHANGELOG_HERE
4+
5+
-- Homebrew Computer Pte Ltd <service@homebrew.ltd> TIME_HERE
6+
7+
cortexso (VERSION) noble; urgency=low
8+
9+
CHANGELOG_HERE
10+
11+
-- Homebrew Computer Pte Ltd <service@homebrew.ltd> TIME_HERE
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Source: cortexso
2+
Section: base
3+
Priority: optional
4+
Maintainer: Homebrew Computer Pte Ltd <service@homebrew.ltd>
5+
Build-Depends: debhelper-compat (= 13)
6+
Standards-Version: 4.6.2
7+
8+
Package: cortexso
9+
Architecture: amd64
10+
Depends: ${shlibs:Depends}, ${misc:Depends}, openmpi-bin, libopenmpi-dev
11+
Description: Cortex
12+
Cortex is an OpenAI-compatible AI engine that developers can use to build LLM apps. It is packaged with a Docker-inspired command-line interface and client libraries. It can be used as a standalone server or imported as a library.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: cortexso
3+
Source: https://cortex.so
4+
5+
Files: *
6+
Copyright: 2023, Homebrew Computer Pte Ltd <service@homebrew.ltd>
7+
License: AGPL-3+
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU Affero General Public License as published by
10+
the Free Software Foundation, either version 3 of the License, or
11+
(at your option) any later version.
12+
.
13+
This program is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU Affero General Public License for more details.
17+
.
18+
You should have received a copy of the GNU Affero General Public License
19+
along with this program. If not, see <https://www.gnu.org/licenses/>.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cortex /usr/bin/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/make -f
2+
%:
3+
dh $@
4+
override_dh_auto_install:
5+
dh_install
6+
override_dh_strip:
7+
dh_strip --exclude=cortex

0 commit comments

Comments
 (0)