@itcase/config 1.7.27 → 1.7.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/config",
3
- "version": "1.7.27",
3
+ "version": "1.7.28",
4
4
  "author": "ITCase",
5
5
  "description": "ITCase Config",
6
6
  "engines": {
@@ -2,25 +2,18 @@ import { execFileSync } from 'node:child_process'
2
2
  import { readFileSync, writeFileSync } from 'node:fs'
3
3
  import { join } from 'node:path'
4
4
 
5
- const MAILRU_WEBDAV_BASE = 'https://webdav.cloud.mail.ru'
6
-
7
5
  /**
8
- * Prepare: bump Android → make APK → Mail.ru (если GIT_WORKFLOW=true).
6
+ * Prepare: bump Android → make APK.
7
+ * Upload в Mail.ru — отдельный CI action, не здесь.
9
8
  *
10
- * Env: SKIP_APK_BUILD, RELEASE_APK_TARGETS (stage,prod),
11
- * MAILRU_USER, MAILRU_APP_PASSWORD, MAILRU_PUBLIC_URL.
9
+ * Env: SKIP_APK_BUILD, RELEASE_APK_TARGETS (stage,prod).
12
10
  *
13
- * @param {{ apkPrefix: string, mailruDir: string }} options
11
+ * @param {{ apkPrefix: string }} options
14
12
  */
15
- function createAndroidAppPreparePlugin({ apkPrefix, mailruDir }) {
13
+ function createAndroidAppPreparePlugin({ apkPrefix }) {
16
14
  if (!apkPrefix) {
17
15
  throw new Error('createAndroidAppPreparePlugin: apkPrefix is required')
18
16
  }
19
- if (!mailruDir) {
20
- throw new Error('createAndroidAppPreparePlugin: mailruDir is required')
21
- }
22
-
23
- const uploadDir = mailruDir.replace(/^\/+|\/+$/g, '')
24
17
 
25
18
  return {
26
19
  prepare: async (_pluginConfig, context) => {
@@ -39,8 +32,6 @@ function createAndroidAppPreparePlugin({ apkPrefix, mailruDir }) {
39
32
  logger.log(`make ${apk.make}`)
40
33
  execFileSync('make', [apk.make], { stdio: 'inherit' })
41
34
  }
42
-
43
- uploadApks(apks, uploadDir, logger)
44
35
  },
45
36
  }
46
37
  }
@@ -77,15 +68,15 @@ function bumpAndroidVersion(version, logger) {
77
68
  /** @returns {{ make: string, name: string, fileName: string }[]} */
78
69
  function resolveApks(apkPrefix, version) {
79
70
  const defs = {
80
- prod: {
81
- name: 'PROD',
82
- fileName: `${apkPrefix}-v${version}.apk`,
83
- make: 'android-apk-prod',
84
- },
85
71
  stage: {
72
+ make: 'android-apk-stage',
86
73
  name: 'STAGE',
87
74
  fileName: `${apkPrefix}-v${version}-STAGE.apk`,
88
- make: 'android-apk-stage',
75
+ },
76
+ prod: {
77
+ make: 'android-apk-prod',
78
+ name: 'PROD',
79
+ fileName: `${apkPrefix}-v${version}.apk`,
89
80
  },
90
81
  }
91
82
 
@@ -109,53 +100,4 @@ function resolveApks(apkPrefix, version) {
109
100
  })
110
101
  }
111
102
 
112
- function uploadApks(apks, uploadDir, logger) {
113
- if (process.env.GIT_WORKFLOW !== 'true') {
114
- logger.log('Skip Mail.ru upload (not CI)')
115
- return
116
- }
117
-
118
- const user = process.env.MAILRU_USER
119
- const password = process.env.MAILRU_APP_PASSWORD
120
- const publicUrl = (process.env.MAILRU_PUBLIC_URL || '').replace(/\/$/, '')
121
-
122
- if (!user || !password || !publicUrl) {
123
- throw new Error(
124
- 'MAILRU_USER, MAILRU_APP_PASSWORD and MAILRU_PUBLIC_URL are required',
125
- )
126
- }
127
-
128
- const uploadBase = `${MAILRU_WEBDAV_BASE}/${uploadDir}`
129
- const downloads = []
130
-
131
- for (const apk of apks) {
132
- logger.log(`Upload ${apk.fileName} to ${uploadBase}/`)
133
- execFileSync(
134
- 'curl',
135
- [
136
- '--fail',
137
- '--silent',
138
- '--show-error',
139
- '--retry',
140
- '2',
141
- '--retry-delay',
142
- '2',
143
- '-T',
144
- join(process.cwd(), 'builds', apk.fileName),
145
- '--user',
146
- `${user}:${password}`,
147
- `${uploadBase}/${apk.fileName}`,
148
- ],
149
- { stdio: 'inherit' },
150
- )
151
- downloads.push({ name: apk.name, url: `${publicUrl}/${apk.fileName}` })
152
- }
153
-
154
- writeFileSync(
155
- join(process.cwd(), 'builds', 'mailru-downloads.json'),
156
- JSON.stringify(downloads),
157
- )
158
- logger.log('APK upload finished — Mail.ru links saved')
159
- }
160
-
161
103
  export { createAndroidAppPreparePlugin }
@@ -1,4 +1,7 @@
1
- import { semanticReleaseApp } from './semanticReleaseApp.js'
1
+ import {
2
+ createSemanticReleaseApp,
3
+ semanticReleaseApp,
4
+ } from './semanticReleaseApp.js'
2
5
  import { semanticReleaseBot } from './semanticReleaseBot.js'
3
6
  import { semanticReleaseDoc } from './semanticReleaseDoc.js'
4
7
  import { semanticReleaseMonorepo } from './semanticReleaseMonorepo.js'
@@ -7,6 +10,7 @@ import { semanticReleaseProject } from './semanticReleaseProject.js'
7
10
  import { semanticReleaseVSMarketplace } from './semanticReleaseVSMarketplace.js'
8
11
 
9
12
  export {
13
+ createSemanticReleaseApp,
10
14
  semanticReleaseApp,
11
15
  semanticReleaseBot,
12
16
  semanticReleaseDoc,
@@ -21,13 +21,13 @@ const DEFAULT_RELEASE_ASSETS = ['builds/*.apk']
21
21
  * - Прикрепляет к GitHub release APK из `builds/`
22
22
  * - Заметки релиза: сначала задачи, потом коммиты
23
23
  *
24
- * Если передан `apk`, в prepare: bump → make → Mail.ru (GIT_WORKFLOW=true).
24
+ * Если передан `apk`, в prepare: bump → make.
25
+ * Upload в Mail.ru — отдельный GitHub Action (не здесь).
25
26
  *
26
27
  * @param {Object} [options]
27
28
  * @param {string|string[]} [options.branches=['master']]
28
29
  * @param {Object} [options.apk]
29
30
  * @param {string} options.apk.prefix - agro-pps → builds/agro-pps-v*.apk
30
- * @param {string} options.apk.mailruDir - папка WebDAV, напр. APK
31
31
  * @param {string[]} [options.versionAssets]
32
32
  * @param {string[]|Object[]} [options.releaseAssets] - по умолчанию builds/{prefix}-v*.apk
33
33
  * @param {Array} [options.preparePlugins]
@@ -44,17 +44,14 @@ function semanticReleaseApp({
44
44
  versionAssets = DEFAULT_VERSION_ASSETS,
45
45
  } = {}) {
46
46
  const androidPrepare = apk
47
- ? [
48
- createAndroidAppPreparePlugin({
49
- apkPrefix: apk.prefix,
50
- mailruDir: apk.mailruDir,
51
- }),
52
- ]
47
+ ? [createAndroidAppPreparePlugin({ apkPrefix: apk.prefix })]
53
48
  : []
54
49
 
55
50
  const githubAssets =
56
51
  releaseAssets ??
57
- (apk?.prefix ? [`builds/${apk.prefix}-v*.apk`] : DEFAULT_RELEASE_ASSETS)
52
+ (apk?.prefix
53
+ ? [`builds/${apk.prefix}-v*.apk`]
54
+ : DEFAULT_RELEASE_ASSETS)
58
55
 
59
56
  return createSemanticReleaseConfig({
60
57
  additionalPlugins: [releaseNotesFromIssuesPlugin],
@@ -76,4 +73,7 @@ function semanticReleaseApp({
76
73
  })
77
74
  }
78
75
 
79
- export { semanticReleaseApp }
76
+ /** @deprecated используй semanticReleaseApp — оставлено для совместимости */
77
+ const createSemanticReleaseApp = semanticReleaseApp
78
+
79
+ export { createSemanticReleaseApp, semanticReleaseApp }