From b6e5c5b1e44d30a94f1be695d38cd50a44f8afab Mon Sep 17 00:00:00 2001 From: jolts Date: Sat, 25 Jan 2025 07:15:40 +0200 Subject: [PATCH] refactor CI workflow to build and publish with Node.js 18.x --- .forgejo/workflows/ci.yml | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 51a388d..bc80691 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -7,39 +7,25 @@ on: branches: [main, master] jobs: - build: + build-and-publish: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x, 18.x, 20.x] - steps: - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: "18.x" + registry-url: "https://registry.npmjs.org" - name: Install dependencies run: npm ci - - name: Lint - run: npm run lint - - name: Build run: npm run build - - name: Run tests - run: npm test - - - name: Generate coverage - run: npm run test:coverage - - - name: Archive coverage - uses: actions/upload-artifact@v3 - with: - name: coverage-${{ matrix.node-version }} - path: coverage - retention-days: 5 + - name: Publish to NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}