Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add js only node client and workflow #21

Merged
merged 1 commit into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion .github/workflows/authzed-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- .github/workflows/authzed-node.yaml
push:
branches:
- master
- main
paths:
- src/**
- .github/workflows/authzed-node.yaml
Expand Down Expand Up @@ -57,3 +57,56 @@ jobs:
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ steps.get_version.outputs.version }}
access: public
build-js-client:
name: Build and Test JS client
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14, 16, 17]
steps:
- uses: actions/checkout@v2
- uses: "authzed/action-spicedb@v1"
with:
version: "latest"
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- uses: bahmutov/npm-install@v1
with:
working-directory: ./
- name: Run build
run: yarn build-js-client
working-directory: ./
- uses: bahmutov/npm-install@v1
with:
working-directory: ./js-dist
- name: Run Yarn tests
run: CI=true yarn only-run-tests
working-directory: ./js-dist
- uses: actions/upload-artifact@v2
with:
name: js-client
path: |
js-dist/**
!js-dist/node_modules/**
publish-js-client-npm:
name: Publish JS client to NPM
needs: build-js-client
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Download js client build
uses: actions/download-artifact@v2
with:
name: js-client
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm install
- uses: battila7/get-version-action@v2
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ steps.get_version.outputs.version }}
access: public
5 changes: 5 additions & 0 deletions js-dist/jasmine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"spec_dir": "src",
"spec_files": ["*.test.js"],
"helpers": []
}
Loading