From 590cffafe74f4137a1c41cc8e17ebb2ddb70a903 Mon Sep 17 00:00:00 2001 From: Dobrunia Kostrigin <48620984+Dobrunia@users.noreply.github.com> Date: Wed, 23 Apr 2025 15:59:42 +0300 Subject: [PATCH 1/2] init --- .github/workflows/npm-publish.yml | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 00000000..75a49918 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,48 @@ +name: Publish CodeX UI to NPM + +on: + push: + branches: + - main + paths: + - '@codexteam/ui/**' + +jobs: + publish-ui: + name: Publish @codexteam/ui package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + - name: Install dependencies + run: yarn install + working-directory: ./@codexteam/ui + - name: Build package + run: yarn build + working-directory: ./@codexteam/ui + - name: Publish package + run: yarn publish --access=public + working-directory: ./@codexteam/ui + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + notify: + needs: publish-ui + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get UI package info + id: ui-package + uses: codex-team/action-nodejs-package-info@v1 + with: + package_json_path: ./@codexteam/ui/package.json + - name: Send a message + uses: codex-team/action-codexbot-notify@v1 + with: + webhook: ${{ secrets.CODEX_BOT_WEBHOOK_HAWK }} + message: '📦 [${{ steps.ui-package.outputs.name }}](${{ steps.ui-package.outputs.npmjs-link }}) ${{ steps.ui-package.outputs.version }} was published' + parse_mode: 'markdown' + disable_web_page_preview: true \ No newline at end of file From cc89ff31f58c31899199606be9d68007ff9c31e2 Mon Sep 17 00:00:00 2001 From: Dobrunia Kostrigin <48620984+Dobrunia@users.noreply.github.com> Date: Sat, 26 Apr 2025 17:38:11 +0300 Subject: [PATCH 2/2] fix --- .github/workflows/npm-publish.yml | 38 ++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 75a49918..3a3305e4 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -11,38 +11,50 @@ jobs: publish-ui: name: Publish @codexteam/ui package runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js from .nvmrc + uses: actions/setup-node@v3 with: - node-version: 20 - registry-url: https://registry.npmjs.org/ + node-version-file: '.nvmrc' + - name: Install dependencies + working-directory: '@codexteam/ui' run: yarn install - working-directory: ./@codexteam/ui + - name: Build package + working-directory: '@codexteam/ui' run: yarn build - working-directory: ./@codexteam/ui - - name: Publish package + + - name: Publish package to npm + working-directory: '@codexteam/ui' run: yarn publish --access=public - working-directory: ./@codexteam/ui env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} notify: + name: Notify in CodexBot needs: publish-ui runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 + - name: Get UI package info id: ui-package uses: codex-team/action-nodejs-package-info@v1 with: - package_json_path: ./@codexteam/ui/package.json + package_json_path: '@codexteam/ui/package.json' + - name: Send a message uses: codex-team/action-codexbot-notify@v1 with: webhook: ${{ secrets.CODEX_BOT_WEBHOOK_HAWK }} - message: '📦 [${{ steps.ui-package.outputs.name }}](${{ steps.ui-package.outputs.npmjs-link }}) ${{ steps.ui-package.outputs.version }} was published' - parse_mode: 'markdown' - disable_web_page_preview: true \ No newline at end of file + message: | + [${{ steps.ui-package.outputs.name }}](${{ steps.ui-package.outputs.npmjs-link }}) v${{ steps.ui-package.outputs.version }} was published + parse_mode: markdown + disable_web_page_preview: true