Skip to content

1.1.0

1.1.0 #80

Workflow file for this run

name: Node.js CI
on:
push:
branches: [ main ]
tags: [ v* ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: textbook/take-action@nodejs
with:
node-version: 18
- run: npm run lint
- run: npm run test:coverage
- run: npm run test:mutation -- --reporters=clear-text,dots
- run: npm run build
- run: npm pack
- run: mv textbook-build-info-*.tgz package.tgz
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: package
path: package.tgz
e2e:
strategy:
matrix:
platform: [ ubuntu-22.04 ]
node: [ 18.3, 18, 20 ]
include:
- node: 18
platform: windows-2022
needs: test
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: actions/download-artifact@v3
with:
name: package
- run: npm init --yes
- run: npm install package.tgz
- run: npx buildinfo -o out.txt
- run: npx buildinfo --output out.txt
- run: npx buildinfo > out.txt
- run: type out.txt
if: contains(matrix.platform, 'windows')
- run: cat out.txt
if: contains(matrix.platform, 'ubuntu')
deploy-github:
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
needs: e2e
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: package
- run: |
gh release create \
'${{ github.ref_name }}' \
--title '${{ github.ref_name }}' \
"package.tgz#NPM package"
env:
GH_TOKEN: ${{ github.token }}
deploy-npm:
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
needs: e2e
permissions:
contents: read
id-token: write
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/download-artifact@v3
with:
name: package
- run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_AUTH_TOKEN}"
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- run: npm publish --provenance package.tgz