From b999d2848f659c604622cc56ae6185df75135e8e Mon Sep 17 00:00:00 2001 From: Malachi Soord Date: Wed, 20 Sep 2023 22:43:26 +0200 Subject: [PATCH] Update repo --- .github/workflows/lint.yml | 19 +++++++++++++------ .github/workflows/publish.yml | 29 +++++++++++++++++++++++++++++ .nvmrc | 1 + 3 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .nvmrc diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0767ad0..6be94ea 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,9 +9,16 @@ jobs: name: Run ESLint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - run: npm install - - run: npm run lint + - name: Checkout the repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Install dependencies + run: npm ci + + - name: Run ESLint + run: npm run lint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..66978b4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +name: Publish +on: + release: + types: [published] + +jobs: + publish: + name: Publish NPM package + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Publish package + uses: JS-DevTools/npm-publish@v2 + with: + token: ${{ secrets.NPM_TOKEN_ORG }} + access: public diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..4a1f488 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18.17.1