Skip to content

Commit

Permalink
chore: update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Jul 8, 2024
1 parent 9a450d9 commit 889b96b
Showing 1 changed file with 63 additions and 5 deletions.
68 changes: 63 additions & 5 deletions .github/workflows/cortex-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ jobs:
runs-on: "ubuntu-20-04"
cmake-flags: ""
build-deps-cmake-flags: ""
ccache-dir: ''
ccache-dir: ""
- os: "mac"
name: "amd64"
runs-on: "macos-13"
cmake-flags: ""
build-deps-cmake-flags: ""
ccache-dir: ''
ccache-dir: ""
- os: "mac"
name: "arm64"
runs-on: "macos-latest"
cmake-flags: "-DMAC_ARM64=ON"
build-deps-cmake-flags: ""
ccache-dir: ''
ccache-dir: ""
- os: "windows"
name: "amd64"
runs-on: "windows-cuda-12-0"
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
run: |
cd cortex-cpp
make pre-package
- name: Code Signing macOS
if: runner.os == 'macOS'
run: |
Expand Down Expand Up @@ -163,6 +163,64 @@ jobs:
AWS_SECRET_ACCESS_KEY: "${{ secrets.MINIO_SECRET_ACCESS_KEY }}"
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}"

## cortex-cpp node binding

# update version in package.json
- name: Install jq
uses: dcarbone/[email protected]

- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: "Update version by tag"
working-directory: cortex-cpp
shell: bash
run: |
echo "Version: ${{ needs.create-draft-release.outputs.version }}"
# Update the version in package.json
jq --arg version "${{ needs.create-draft-release.outputs.version }}" '.version = $version' package.json > /tmp/package.json
mv /tmp/package.json package.json
# build prebuilds
- name: Build Prebuilds
working-directory: cortex-cpp
run: |
yarn | yarn prebuilds
# upload prebuilds
- name: Upload Prebuilds Darwin
uses: actions/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && matrix.os == 'mac'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./cortex-cpp/cortex-cpp-v${{ needs.create-draft-release.outputs.version }}-napi-v8-darwin-{{ matrix.name }}.tar.gz
asset_name: cortex-cpp-v${{ needs.create-draft-release.outputs.version }}-napi-v8-darwin-{{ matrix.name }}.tar.gz
asset_content_type: application/gzip

- name: Upload Prebuilds Others
uses: actions/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && matrix.os != 'mac'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./cortex-cpp/cortex-cpp-v${{ needs.create-draft-release.outputs.version }}-napi-v8-${{ matrix.os }}-{{ matrix.name }}.tar.gz
asset_name: cortex-cpp-v${{ needs.create-draft-release.outputs.version }}-napi-v8-${{ matrix.os }}-{{ matrix.name }}.tar.gz
asset_content_type: application/gzip

# Setup .npmrc file to publish to npm - upload only once
- run: npm publish --access public
if: runner.os == 'linux'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: ./cortex-cpp

## cortex-cpp node binding

build-cortex-single-binary:
runs-on: ${{ matrix.runs-on }}
needs: [create-draft-release]
Expand Down Expand Up @@ -229,7 +287,7 @@ jobs:
with:
python-version: "3.10"

- run: pip3 install --upgrade setuptools
- run: pip3 install --upgrade setuptools
if: runner.os == 'macOS'

- run: yarn install && yarn build:binary
Expand Down

0 comments on commit 889b96b

Please sign in to comment.