diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..3611e0ab --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,42 @@ +name: Publish to npm + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js LTS + uses: actions/setup-node@v4 + with: + node-version: lts/* + registry-url: https://registry.npmjs.org/ + + - name: Install dependencies and build + run: npm install + + - name: Install Cosma + run: npm install . --global + + # tests + + - name: Build cosmoscopes + run: sh ./e2e/exec-modelize.sh + + - name: Run unit tests + run: npm run test:unit -- --verbose + + - name: Run E2E tests + run: npm run test:e2e + + # publish + + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --provenance