From 5ecde7e78c216616dfd90d8e8057c6612921d44e Mon Sep 17 00:00:00 2001 From: Erlend Oftedal Date: Thu, 15 Feb 2024 21:35:57 +0100 Subject: [PATCH] more workflows --- .github/workflows/publish.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d59c206 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish Package to npmjs +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "18.x" + registry-url: "https://registry.npmjs.org" + - run: npm install -g npm + - run: npm ci + - name: Lint + run: npm run check + - name: Build + run: npm run build + - name: Integration test + run: npm run test + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c08e282 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Node.js CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + + strategy: + matrix: + node-version: [20.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run build + - run: npm test