Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
### Универсальный модуль сборки и публикации backend пакетов в npm registry
name: Build and Publish Backend package to npm registry

on:
workflow_call:
inputs:
runner:
description: "Указывает какой раннер будет использоваться для запуска флоу"
required: false
default: "sravni_infra"
type: string
secrets:
GH_TOKEN:
required: true
ARTIFACTORY_SVC_TOKEN:
required: true

jobs:
build_and_publish:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v4
with:
node-version: '20.x'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мб сразу 22 укажите?

registry-url: https://artifactory.yc.prod.infra.sravni.market/artifactory/api/npm/sravni_npm_group/

- name: Install yarn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn вам не нужен. вы же им не пользуетесь. Удали шаг

env:
NODE_AUTH_TOKEN: ${{ secrets.ARTIFACTORY_SVC_TOKEN }}
run: npm install -g yarn

- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.ARTIFACTORY_SVC_TOKEN }}
run: yarn install --frozen-lockfile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тебе нужно тут использовать ваш менеджер пакетов


- name: Publish dev version of package
if: contains(github.ref, '-dev')
env:
NODE_AUTH_TOKEN: ${{ secrets.ARTIFACTORY_SVC_TOKEN }}
run: yarn publish --tag dev

- name: Publish stable version of package
if: contains(github.ref, '-dev') != true
env:
NODE_AUTH_TOKEN: ${{ secrets.ARTIFACTORY_SVC_TOKEN }}
run: yarn publish

- name: Create release
uses: "marvinpinto/action-automatic-releases@latest"
if: contains(github.ref, '-dev') != true
with:
repo_token: "${{ secrets.GH_TOKEN }}"
prerelease: false