From 874ecfee8a58405052d53c0ff2f0d235f6f8aa4d Mon Sep 17 00:00:00 2001 From: Matus Backor Date: Tue, 3 Dec 2024 13:30:49 +0100 Subject: [PATCH] Update build and release --- .github/CODEOWNERS | 7 +------ .github/workflows/build.yml | 36 +++++++++++++++++------------------ .github/workflows/release.yml | 22 ++++++++++++--------- package-lock.json | 8 ++++---- package.json | 2 +- 5 files changed, 37 insertions(+), 38 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c3842ea..75c180d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +1 @@ -# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths. -# See https://help.github.com/articles/about-code-owners/ - -# Format: -# Example: * @kontent-ai/developer-relations -* +* @JiriLojda @kontent-ai/developer-relations diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b10de9f..11bc895 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,19 +1,19 @@ -# For more information do to https://kontent-ai.github.io/ci-and-automation/ci-and-automation +name: Lint & Build -name: "Build" # Represents the name of the whole action. -on: # Specifies the section where we describe our build triggers. - push: # The action runs with push. - pull_request: # The action runs with a pull request. - schedule: # Specifies the section where we describe the schedule of running the action. - - cron: '0 18 * * 1' # The CRON expression describes when to run the action. -jobs: # Specifies the section where we describe our jobs. - Build: # Specific job section. - runs-on: ubuntu-latest # Describes the environment. - steps: # Specifies the section where we describe the job's steps. - - uses: actions/checkout@v3 - - name: Install dependencies - run: npm install - - name: Build - run: npm run build - - name: Check code format - run: npm run format-check +on: + push: + branches: [main] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js from .nvmrc file + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + - run: npm ci + - run: npm run format-check + - run: npm run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ccdb878..4bf4159 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,17 +8,21 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' registry-url: 'https://registry.npmjs.org' - - name: Install dependencies - run: npm install - - name: Build - run: npm run build - - name: Publish - run: npm publish --access public + + - run: npm ci + - run: npm run build + + - run: npm publish --access=public + if: ${{!github.event.release.prerelease}} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }} + - run: npm publish --tag prerelease + if: ${{github.event.release.prerelease}} env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }} diff --git a/package-lock.json b/package-lock.json index d689019..eb4754a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "just-a-test-of-custom-apps", - "version": "0.2.12", + "name": "@kontent-ai/custom-app-sdk-js", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "just-a-test-of-custom-apps", - "version": "0.2.12", + "name": "@kontent-ai/custom-app-sdk-js", + "version": "1.0.0", "license": "MIT", "dependencies": { "zod": "^3.23.8" diff --git a/package.json b/package.json index dae7396..f69fb67 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "The Kontent.ai Custom App SDK enhances the integration of your custom app with the Kontent.ai platform.", "license": "MIT", - "author": "Matus Backor", + "author": "Kontent.ai", "keywords": ["Kontent.ai", "Kontent AI", "Kontent Custom App SDK JS"], "main": "./dist/index.js", "types": "./dist/index.d.ts",