-
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
Showing
1 changed file
with
52 additions
and
0 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 |
---|---|---|
|
@@ -163,6 +163,58 @@ 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 | ||
uses: actions/[email protected] | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-draft-release.outputs.upload_url }} | ||
{{if eq matrix.os "macos"}} | ||
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 | ||
{{else}} | ||
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 | ||
{{end}} | ||
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] | ||
|