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 d063c9d commit 6fd3fe9
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/cortex-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 6fd3fe9

Please sign in to comment.