diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f04beb6..4cb3f02 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,45 +1,28 @@ name: Release and Publish on: - push: - branches: - - main - - next + push: + branches: + - main + - next jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 18.x - - name: npm install - run: | - npm install - - name: npm test - run: | - npm test + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 - release: - name: Release - runs-on: ubuntu-latest - needs: [test] - steps: - - name: Checkout - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 18.x - - name: npm install - run: | - npm install - - name: npx semantic-release - run: | - npx semantic-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - run: npm install + + - run: npm test + + - run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a6e3d72..f91cc96 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,27 +1,29 @@ name: Run Tests -on: [push, pull_request] +on: + push: + branches-ignore: + - main + - alpha + - beta + - next jobs: build: - runs-on: ubuntu-latest strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - node-version: [18.x] + node-version: [20] + runs-on: ${{ matrix.os }} + steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - name: npm install - run: | - npm install - env: - CI: true - - name: npm test - run: | - npm test - env: - CI: true + + - run: npm install + + - run: npm test diff --git a/.npmrc b/.npmrc index 9cf9495..0ca8d2a 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ -package-lock=false \ No newline at end of file +package-lock=false +save-exact=true diff --git a/package.json b/package.json index c0a4a59..db34348 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "scripts": { "lint": "eslint .", "lint:fix": "eslint --fix .", - "test": "NODE_OPTIONS=--conditions=development tap --timeout=60000 --disable-coverage --allow-empty-coverage test/**/*.test.js", + "test": "cross-env NODE_OPTIONS=--conditions=development tap --timeout=60000 --disable-coverage --allow-empty-coverage test/**/*.test.js", "prepublish": "tsc" }, "keywords": [], @@ -80,12 +80,13 @@ "access": "public" }, "devDependencies": { + "@babel/eslint-parser": "^7.11.0", "@fastify/cors": "^8.3.0", "@semantic-release/changelog": "6.0.3", "@semantic-release/git": "10.0.1", "@types/http-errors": "^2.0.1", "@types/ws": "^8.5.5", - "@babel/eslint-parser": "^7.11.0", + "cross-env": "7.0.3", "eslint": "8.57.0", "eslint-config-airbnb-base": "15.0.0", "eslint-config-prettier": "9.1.0",