From 0ef9a799f9fe60af555ad28578be9654643816a9 Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Wed, 5 Oct 2022 17:13:16 -0400 Subject: [PATCH] Add GitHub workflows: build, lint, prettier, npm publish --- .github/workflows/build.yml | 13 +++++++++++++ .github/workflows/lint.yml | 13 +++++++++++++ .github/workflows/npm.yml | 18 ++++++++++++++++++ .github/workflows/prettier.yml | 13 +++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/npm.yml create mode 100644 .github/workflows/prettier.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..dd1a382 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,13 @@ +name: Build +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '12.x' + - run: npm ci + - run: npm run build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..dccf5a1 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,13 @@ +name: Lint +on: [push] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '12.x' + - run: npm ci + - run: npm run lint diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..2978cdd --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,18 @@ +name: Publish Package to npmjs +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 0000000..c9d9706 --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,13 @@ +name: Prettier +on: [push] +jobs: + prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '12.x' + - run: npm ci + - run: npm run prettier