diff --git a/.github/workflows/cortex-build.yml b/.github/workflows/cortex-build.yml index b763aecef..45fb81b74 100644 --- a/.github/workflows/cortex-build.yml +++ b/.github/workflows/cortex-build.yml @@ -2,7 +2,7 @@ name: CI Cortex Release on: push: - tags: ["v[0-9]+.[0-9]+.[0-9]+"] + tags: ["v[0-9]+.[0-9]+.[0-9]+", "v[0-9]+.[0-9]+.[0-9]+-*"] paths: ["cortex-cpp/**", "cortex-js/**"] workflow_dispatch: @@ -416,6 +416,14 @@ jobs: asset_path: ./cortex-js/cortexso.deb asset_name: cortex-installer-${{ needs.create-draft-release.outputs.version }}-${{ matrix.name }}-${{ matrix.os }}.deb asset_content_type: application/gzip + + # Upload artifact for package manager + - name: Upload Artifact + if: runner.os == 'Linux' + uses: actions/upload-artifact@v2 + with: + name: cortex-linux + path: ./cortex-js/cortex update_release_draft: needs: [build-and-test, build-cortex-single-binary] @@ -440,3 +448,59 @@ jobs: # disable-autolabeler: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + # Add jobs with approval + public_package_manager: + needs: [create-draft-release, update_release_draft] + runs-on: ubuntu-latest + environment: package-manager + permissions: + contents: read + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: cortex-linux + path: ./cortex-linux + + - name: install dependencies + run: | + ls -al ./cortex-linux + sudo apt-get install dput devscripts build-essential debhelper-compat pbuilder debootstrap devscripts -y + + - name: import gpg key with subkey + uses: crazy-max/ghaction-import-gpg@v4 + with: + gpg_private_key: ${{ secrets.HOMEBREW_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.HOMEBREW_GPG_PASSPHRASE }} + fingerprint: ${{ secrets.HOMEBREW_GPG_FINGERPRINT }} + + - run: | + mkdir -p package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian + cp package-managers-template/launchpad/cortexso/debian/* package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian/ + cp ./cortex-linux/cortex package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/ + + - name: Get release notes + id: release_notes + run: | + RELEASE_NOTES=$(curl -s -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/tags/${VERSION} | jq -r '.body') + echo "RELEASE_NOTES=${RELEASE_NOTES}" >> $GITHUB_ENV + - name: Update change log + run: | + sed -i "s/VERSION/${{ needs.create-draft-release.outputs.version }}/g" package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian/changelog + sed -i "s/CHANGELOG_HERE/${{ env.RELEASE_NOTES }}/g" package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian/changelog + timestamp=$(date -u +"%a, %d %b %Y %H:%M:%S +0000") + sed -i "s/TIME_HERE/${timestamp}/g" package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }}/debian/changelog + + - name: Build package + run: | + cd package-managers-template/launchpad/cortexso-${{ needs.create-draft-release.outputs.version }} + echo "y" | debuild -S -sa -k${{ secrets.HOMEBREW_GPG_FINGERPRINT }} + sudo pbuilder create --distribution jammy --debootstrapopts --variant=buildd + sudo sudo pbuilder build ../cortexso_${{ needs.create-draft-release.outputs.version }}.dsc + dput ppa:cortexlabs/cortex cortexso_${{ needs.create-draft-release.outputs.version }}_source.changes + diff --git a/package-managers-template/launchpad/cortexso/debian/changelog b/package-managers-template/launchpad/cortexso/debian/changelog new file mode 100644 index 000000000..86d178eeb --- /dev/null +++ b/package-managers-template/launchpad/cortexso/debian/changelog @@ -0,0 +1,11 @@ +cortexso (VERSION) jammy; urgency=low + + CHANGELOG_HERE + + -- Homebrew Computer Pte Ltd TIME_HERE + +cortexso (VERSION) noble; urgency=low + + CHANGELOG_HERE + + -- Homebrew Computer Pte Ltd TIME_HERE \ No newline at end of file diff --git a/package-managers-template/launchpad/cortexso/debian/control b/package-managers-template/launchpad/cortexso/debian/control new file mode 100644 index 000000000..d637974fd --- /dev/null +++ b/package-managers-template/launchpad/cortexso/debian/control @@ -0,0 +1,12 @@ +Source: cortexso +Section: base +Priority: optional +Maintainer: Homebrew Computer Pte Ltd +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.6.2 + +Package: cortexso +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, openmpi-bin, libopenmpi-dev +Description: Cortex + 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. \ No newline at end of file diff --git a/package-managers-template/launchpad/cortexso/debian/copyright b/package-managers-template/launchpad/cortexso/debian/copyright new file mode 100644 index 000000000..828023e47 --- /dev/null +++ b/package-managers-template/launchpad/cortexso/debian/copyright @@ -0,0 +1,19 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: cortexso +Source: https://cortex.so + +Files: * +Copyright: 2023, Homebrew Computer Pte Ltd +License: AGPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . \ No newline at end of file diff --git a/package-managers-template/launchpad/cortexso/debian/install b/package-managers-template/launchpad/cortexso/debian/install new file mode 100644 index 000000000..0eb8dba40 --- /dev/null +++ b/package-managers-template/launchpad/cortexso/debian/install @@ -0,0 +1 @@ +cortex /usr/bin/ \ No newline at end of file diff --git a/package-managers-template/launchpad/cortexso/debian/rules b/package-managers-template/launchpad/cortexso/debian/rules new file mode 100644 index 000000000..7efda1953 --- /dev/null +++ b/package-managers-template/launchpad/cortexso/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f +%: + dh $@ +override_dh_auto_install: + dh_install +override_dh_strip: + dh_strip --exclude=cortex