From 373f20565a3c96199311ee47a1a6524f2ce5ea9b Mon Sep 17 00:00:00 2001 From: Jiri Lojda Date: Fri, 9 Jun 2023 11:37:05 +0200 Subject: [PATCH] Add release pipeline to publish to npm and rename to @kontent-ai scoped package --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ .nvmrc | 1 + package.json | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml create mode 100644 .nvmrc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a8b2178 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +on: + release: + types: [published] + +name: publish-to-npm +jobs: + publish: + runs-on: ubuntu-latest + + + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' + - name: Extract version from tag + id: get_version + uses: battila7/get-version-action@v2 + - run: npm --no-git-tag-version version ${{ steps.get_version.outputs.version-without-v }} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }} + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Adjust release version to ${{ steps.get_version.outputs.version-without-v }} + branch: ${{ github.event.repository.default_branch }} \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..1a2f5bd --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/* \ No newline at end of file diff --git a/package.json b/package.json index d1b8a2e..70f1f48 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "eslint-config-kontent-ai", + "name": "@kontent-ai/eslint-config", "version": "0.1.8", "description": "Eslint configuration used for packages in Kontent.ai", "main": "index.js",