Skip to content

implement new policy, rule, authorization, and organization models #26

implement new policy, rule, authorization, and organization models

implement new policy, rule, authorization, and organization models #26

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Node.js Package
on:
workflow_dispatch:
push:
branches:
- "**"
pull_request:
branches:
- "main"
release:
types: [created]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
- run: yarn
- run: yarn build
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
test:
name: Test
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- run: yarn
- run: yarn test
publish-npm:
if: github.event_name == 'release' && github.event.action == 'created'
name: Publish to NPM
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
registry-url: https://registry.npmjs.org
# Defaults to the user or organization that owns the workflow file
scope: "@codrjs"
- run: yarn
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- run: cd dist && yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_ACCESS_TOKEN}}