Skip to content

Commit

Permalink
node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
garlab committed Sep 25, 2024
1 parent 46b581e commit 35d35bc
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 3,583 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Branch checks

on:
push:

jobs:
checks:
name: Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
- run: npm test
26 changes: 0 additions & 26 deletions .github/workflows/node.js.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: NPM Publish Package

on:
release:
types: [created]

jobs:
test:
name: Test before publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'

- name: Check if versions match
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
RELEASE_TAG=${GITHUB_REF#refs/tags/}
echo "Release tag: $RELEASE_TAG"
echo "Package.json version: $PACKAGE_VERSION"
if [ "$PACKAGE_VERSION" != "$RELEASE_TAG" ]; then
echo "Version mismatch: Release tag ($RELEASE_TAG) does not match package.json version ($PACKAGE_VERSION)."
exit 1
fi
- run: npm test

publish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
registry-url: 'https://registry.npmjs.org'

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
20.17.0

5 changes: 1 addition & 4 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ coverage
test

# CI
.circleci
.codeclimate.yml
.jenkins.yml
.travis.yml
.github

# Editor settings
.editorconfig
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"singleQuote": true,
"semi": false,
trailingComma: "es5",
"trailingComma": "es5"
}
Loading

0 comments on commit 35d35bc

Please sign in to comment.