Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
au2001 committed Jan 24, 2024
0 parents commit f9ac0c8
Show file tree
Hide file tree
Showing 6 changed files with 3,205 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
env: {
node: true,
},
extends: "@avicenne-studio",
};
47 changes: 47 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish NPM package

on:
push:
tags:
- v*.*.*
- v*.*.*-*-*

jobs:
publish:
runs-on: ubuntu-latest

permissions:
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org
cache: npm

- name: Check tag version with package.json version
run: |
TAG_VERSION=$(echo $GITHUB_REF | sed -n 's/refs\/tags\/v\([0-9]*\.[0-9]*\.[0-9]*\(-[a-zA-Z0-9]*\)\?\)/\1/p')
PACKAGE_VERSION=$(node -p "require('./package.json').version")
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
exit 1
fi
- name: Install dependencies
run: npm ci

- name: Update version
run: npm version $TAG_VERSION --allow-same-version

- name: Publish to NPM
run: npm publish --provenance --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "@avicenne-studio/prettier-config";
Loading

0 comments on commit f9ac0c8

Please sign in to comment.