Skip to content

feat: Add dev workflow #1

feat: Add dev workflow

feat: Add dev workflow #1

Workflow file for this run

name: Release
on:
push:
branches:
- dev
concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
check-packages:
name: Check packages for mobile and tv platform
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.gh_token }}
NPM_REGISTRY_TOKEN: ${{ secrets.npm_registry_token }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
show-progress: false
- name: Prepare repository
run: git fetch --unshallow --tags
- name: Unset header
# https://github.com/intuit/auto/issues/1030
run: git config --local --unset http.https://github.com/.extraheader
- name: Prepare environment
uses: ./.github/actions/prepare-environment
- name: Lerna bootstrap for mobile platform
run: npm run bootstrap:mobile
- name: Lerna bootstrap for tv platform
run: npm run bootstrap:tv
publish-packages:
name: Prepare and publish dev version for all platforms
runs-on: ubuntu-latest
needs: ["check-packages"]
env:
GITHUB_TOKEN: ${{ secrets.gh_token }}
NPM_REGISTRY_TOKEN: ${{ secrets.npm_registry_token }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
clean: true
fetch-depth: 0
- name: Prepare repository
run: git fetch --tags
- name: Unset header
# https://github.com/intuit/auto/issues/1030
run: git config --local --unset http.https://github.com/.extraheader
- name: Unset header
# https://github.com/intuit/auto/issues/1030
run: git config advice.addIgnoredFile false
- name: Prepare environment
uses: ./.github/actions/prepare-environment
# Подготовка и публикация пакетов с компонентами для мобильной платформы
- name: Update lerna config with all mode
run: MODE="all" npm run set-lerna-packages
- name: Prepare packages for native platform
run: PLATFORM="mobile" npm run bootstrap
- name: Update packages version
run: npm run bump-version -- --conventional-prerelease --preid "dev-$(git rev-parse --short HEAD)"
- name: Replace dependencies and packages name
run: PLATFORM="mobile" npm run replace-dependencies
- name: Update lerna config with components mode
run: MODE="components" npm run set-lerna-packages
- name: Publish component packages
run: PLATFORM="mobile" TAG="dev" npm run components-publish
- name: Revert bump version
run: npm run revert-bump-version
# Подготовка и публикация пакетов с компонентами для ТВ платформы
- name: Update lerna config with all mode
run: MODE="all" npm run set-lerna-packages
- name: Prepare packages for native platform
run: PLATFORM="tv" npm run bootstrap
- name: Update packages version
run: npm run bump-version -- --conventional-prerelease --preid "dev-$(git rev-parse --short HEAD)"
- name: Replace dependencies and packages name
run: PLATFORM="tv" npm run replace-dependencies
- name: Update lerna config with components mode
run: MODE="components" npm run set-lerna-packages
- name: Publish component packages
run: PLATFORM="tv" TAG="dev" npm run components-publish
- name: Revert bump version
run: npm run revert-bump-version
# Подготовка и публикация пакетов с темами
- name: Update lerna config with themes mode
run: MODE="themes" npm run set-lerna-packages
- name: Update packages version
run: npm run bump-version -- --conventional-prerelease --preid "dev-$(git rev-parse --short HEAD)"
- name: Publish themes packages
run: npx lerna exec -- npm publish --tag dev
# Шаг отображающий актаульное состояние package файлов
- name: Show diff
run: git diff