-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (94 loc) · 4.22 KB
/
publish-alpha.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Release
on:
pull_request:
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 alpha 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 "alpha-$(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="alpha" 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 "alpha-$(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="alpha" 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 "alpha-$(git rev-parse --short HEAD)"
- name: Publish themes packages
run: npx lerna exec -- npm publish --tag alpha
# Шаг отображающий актаульное состояние package файлов
- name: Show diff
run: git diff