ci: Update workflows #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
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 latest 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 | |
# Мастеровый шаг | |
- name: Save updated packages version | |
run: npm run platform:mobile | |
- 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="latest" npm run components-publish | |
- name: Revert bump version | |
run: npm run revert-bump-version | |
# Мастеровый шаг | |
- name: Cleanup package files | |
run: npm run remove-package-files | |
# Подготовка и публикация пакетов с компонентами для ТВ платформы | |
- 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 | |
# Мастеровый шаг | |
- name: Save updated packages version | |
run: npm run platform:tv | |
- 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="latest" npm run components-publish | |
- name: Revert bump version | |
run: npm run revert-bump-version | |
# Мастеровый шаг | |
- name: Cleanup package files | |
run: npm run remove-package-files | |
# Подготовка и публикация пакетов с темами | |
- name: Update lerna config with themes mode | |
run: MODE="themes" npm run set-lerna-packages | |
- name: Update packages version | |
run: npm run bump-version | |
- name: Publish themes packages | |
run: npx lerna exec -- npm publish | |
# Мастеровый шаг | |
- name: Update lerna config with all mode | |
run: MODE="all" npm run set-lerna-packages | |
# Шаг отображающий актаульное состояние package файлов | |
- name: Show diff | |
run: git diff | |
# Чтобы появились package.json файлы, иначе пре-пуш хук сломается | |
- name: Add package files | |
run: npm run platform:mobile | |
- name: Commit & Push update packages | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.gh_token }} | |
message: 'chore: Update packages versions [skip ci]' | |
branch: 'main' | |
author_name: Salute Frontend Team | |
author_email: [email protected] |