Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Sep 12, 2024
1 parent 64edfcb commit 2f80ee8
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: build

on: push

jobs:
build:
runs-on: macos-14

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download models
run: |
npm install -g @frost-beta/huggingface
huggingface download --filter=*.json --filter=*.safetensors openai/clip-vit-large-patch14
- name: Test
run: |
yarn
yarn prepack
yarn tsx test.ts clip-vit-large-patch14
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get tag
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Set package version
run: |
npm config set git-tag-version=false
npm version $VERSION
- name: Install deps
run: yarn

- name: Publish npm package
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
ignore-scripts: false
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ package-lock.json
npm-debug.log
yarn-error.log
/node_modules/
/weights-*/
/clip-vit-*/
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ package-lock.json
npm-debug.log
yarn-error.log
/node_modules/
/weights-*/
/clip-vit-*/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"devDependencies": {
"@types/node": "22.5.4",
"tsx": "4.19.1",
"typescript": "5.6.2"
},
"dependencies": {
Expand Down

0 comments on commit 2f80ee8

Please sign in to comment.