Skip to content

Commit

Permalink
Github actions script
Browse files Browse the repository at this point in the history
  • Loading branch information
atmgrifter00 committed Mar 28, 2023
1 parent b6ca777 commit 431163c
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'main'

on:
pull_request:
push:
branches:
- '**'
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# Install dependencies
- uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
# Specify npm version
# See: https://github.com/actions/setup-node/issues/529
- run: npm i -g npm@8
- run: npm ci

# Build
- run: npm run build

# Pack
- run: npm pack
- uses: actions/upload-artifact@v3
with:
name: packages
path: |
flot-*.tgz
if-no-files-found: error

# Test
- run: npm run test

# Publish web npm package
- if: startsWith(github.ref, 'refs/tags/v')
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 431163c

Please sign in to comment.