eitri-cli 1.50.0 → 1.51.0-beta.1

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.
@@ -25,8 +25,9 @@ clean_path = "/sources"
25
25
  shared_tags_json_path = "/user/:workspaceId/index.json"
26
26
  setup = "/v2/workspace/setup"
27
27
  version = "/version"
28
- upload_all = "/file-upload/uploadAll"
29
- file_upload = "/file-upload/single"
28
+ upload_all = "/v3/file-upload/uploadAll"
29
+ file_upload = "/v3/file-upload/single"
30
+ batch_upload = "/v3/file-upload/sync"
30
31
  setup_app = "/v2/workspace/setup-app"
31
32
  publish = "/publish"
32
33
 
@@ -25,8 +25,9 @@ clean_path = "/sources"
25
25
  shared_tags_json_path = "/user/:workspaceId/index.json"
26
26
  setup = "/v2/workspace/setup"
27
27
  version = "/version"
28
- upload_all = "/file-upload/uploadAll"
29
- file_upload = "/file-upload/single"
28
+ upload_all = "/v3/file-upload/uploadAll"
29
+ file_upload = "/v3/file-upload/single"
30
+ batch_upload = "/v3/file-upload/sync"
30
31
  setup_app = "/v2/workspace/setup-app"
31
32
  publish = "/publish"
32
33
 
@@ -25,8 +25,9 @@ clean_path = "/sources"
25
25
  shared_tags_json_path = "/user/:workspaceId/index.json"
26
26
  setup = "/v2/workspace/setup"
27
27
  version = "/version"
28
- upload_all = "/file-upload/uploadAll"
29
- file_upload = "/file-upload/single"
28
+ upload_all = "/v3/file-upload/uploadAll"
29
+ file_upload = "/v3/file-upload/single"
30
+ batch_upload = "/v3/file-upload/sync"
30
31
  setup_app = "/v2/workspace/setup-app"
31
32
  publish = "/publish"
32
33
 
@@ -9,7 +9,8 @@ clean_path = "/sources"
9
9
  shared_tags_json_path = "/user/:workspaceId/index.json"
10
10
  setup = "/v2/workspace/setup"
11
11
  version = "/version"
12
- upload_all = "/file-upload/uploadAll"
13
- file_upload = "/file-upload/single"
12
+ upload_all = "/v3/file-upload/uploadAll"
13
+ file_upload = "/v3/file-upload/single"
14
+ batch_upload = "/v3/file-upload/sync"
14
15
  setup_app = "/v2/workspace/setup-app"
15
16
  publish = "/publish"
@@ -25,8 +25,9 @@ clean_path = "/sources"
25
25
  shared_tags_json_path = "/user/:workspaceId/index.json"
26
26
  setup = "/v2/workspace/setup"
27
27
  version = "/version"
28
- upload_all = "/file-upload/uploadAll"
29
- file_upload = "/file-upload/single"
28
+ upload_all = "/v3/file-upload/uploadAll"
29
+ file_upload = "/v3/file-upload/single"
30
+ batch_upload = "/v3/file-upload/sync"
30
31
  setup_app = "/v2/workspace/setup-app"
31
32
  publish = "/publish"
32
33
 
@@ -72,7 +72,6 @@ export declare function start(args: StartArguments): Promise<void>
72
72
  export declare function create(args: CreateArguments): Promise<void>
73
73
  export declare function updateChecker(): void
74
74
  export declare function selfUpdate(): Promise<void>
75
- export declare function gpt(): Promise<void>
76
75
  export declare function connectionCheck(): Promise<void>
77
76
  export declare function pushVersion(args: PushArgs): Promise<void>
78
77
  export declare function login(args: LoginArgs): Promise<void>
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { publish, runTest, eitriLibs, doctor, start, create, updateChecker, selfUpdate, gpt, connectionCheck, pushVersion, login, version, app, workspace, agents } = nativeBinding
313
+ const { publish, runTest, eitriLibs, doctor, start, create, updateChecker, selfUpdate, connectionCheck, pushVersion, login, version, app, workspace, agents } = nativeBinding
314
314
 
315
315
  module.exports.publish = publish
316
316
  module.exports.runTest = runTest
@@ -320,7 +320,6 @@ module.exports.start = start
320
320
  module.exports.create = create
321
321
  module.exports.updateChecker = updateChecker
322
322
  module.exports.selfUpdate = selfUpdate
323
- module.exports.gpt = gpt
324
323
  module.exports.connectionCheck = connectionCheck
325
324
  module.exports.pushVersion = pushVersion
326
325
  module.exports.login = login
package/index.js CHANGED
@@ -1,69 +1,64 @@
1
1
  process.env["NODE_CONFIG_DIR"] = __dirname + "/config/";
2
2
  const commander = require("commander");
3
3
  const program = new commander.Command();
4
- const emoji = require("emojilib");
5
4
  const path = require("path");
6
5
  const VegvisirCommand = require("./src/modules/vegvisir/VegvisirCommand");
7
6
  const AppCommand = require("./src/modules/app/AppCommand");
8
- const debug = require("debug")("eitri:run");
9
7
 
10
8
  const globalEitriCLIV2 = require("./eitri-cli-v2/index.js");
11
9
  const AgentsCommands = require("./src/modules/agents/AgentsCommands");
12
10
 
13
11
  const checkVerbose = () => {
14
-
15
- const argsList = Array.isArray(process?.argv) && process.argv.length > 0 ? process.argv : [];
12
+ const argsList =
13
+ Array.isArray(process?.argv) && process.argv.length > 0 ? process.argv : [];
16
14
 
17
15
  if (argsList.length > 0) {
18
- const verboseArgs = argsList.filter(arg => arg === "-v" || arg === "--verbose");
16
+ const verboseArgs = argsList.filter(
17
+ (arg) => arg === "-v" || arg === "--verbose",
18
+ );
19
19
 
20
20
  if (verboseArgs.length > 0) {
21
21
  process.env.RUST_LOG = "info";
22
22
  }
23
-
24
23
  }
25
- }
24
+ };
26
25
 
27
26
  const run = async () => {
28
-
29
27
  checkVerbose();
30
- debug("Iniciando run()");
31
28
  // Temporariamente necessário por conta de no contexto do Rust não saber o diretório atual, dessa forma exportando o fullPath do config é possível.
32
29
  // Quando se tornar uma CLI somente em rust no processo de instalação podemos declarar o caminho, como é via NPM pode ter caminhos variados de acordo com sistema de versionamento, NVM, Volta, ASDF é necessário a variável abaixo.
33
30
  process.env.CONFIG_DIR_PATH = path.join(__dirname, "eitri-cli-v2", "config");
34
31
 
35
-
36
-
37
32
  try {
38
33
  const hasCommandsList = process.argv.length > 2;
39
34
  if (hasCommandsList) {
40
35
  const command = process.argv[2];
41
36
 
42
- const showCheckConnection = command !== "version" && command !== "-v"
43
- const showCheckUpdate = command !== "--version" && command !== "-v" && command !== "self-update";
37
+ const showCheckConnection = command !== "version" && command !== "-v";
38
+ const showCheckUpdate =
39
+ command !== "--version" &&
40
+ command !== "-v" &&
41
+ command !== "self-update";
44
42
 
45
43
  if (showCheckConnection) await globalEitriCLIV2.connectionCheck();
46
44
  if (showCheckUpdate) globalEitriCLIV2.updateChecker();
47
45
  }
48
- } catch (error) {
49
- debug("Erro ao verificar atualização", { message: error?.message, error: error });
50
- }
46
+ } catch (error) {}
51
47
 
52
48
  program.option("-v, --version", "Mostra a versão da CLI").action(() => {
53
- globalEitriCLIV2.version()
49
+ globalEitriCLIV2.version();
54
50
  });
55
51
 
56
52
  program
57
53
  .command("login")
58
54
  .description(
59
- "Configura suas credenciais de desenvolvedor no dispositivo local"
55
+ "Configura suas credenciais de desenvolvedor no dispositivo local",
60
56
  )
61
57
  .option("--yes", "Aceita o redirecionamento para o console")
62
58
  .option("-v, --verbose", "Exibe mais logs")
63
59
  .action(async (cmdObj) => {
64
- await globalEitriCLIV2.login(cmdObj)
65
- return
66
-
60
+ await globalEitriCLIV2.login(cmdObj);
61
+ return;
67
62
  });
68
63
 
69
64
  program
@@ -72,14 +67,17 @@ const run = async () => {
72
67
  .option("--yes", "Aceita os valores default para nome título e organização")
73
68
  .option(
74
69
  "--application <application>",
75
- "Define o application de execução do Eitri-App"
70
+ "Define o application de execução do Eitri-App",
71
+ )
72
+ .option(
73
+ "-t, --template",
74
+ "Fornece uma variedade de templates para utilizar ao criar o Eitri-App",
76
75
  )
77
- .option("-t, --template", "Fornece uma variedade de templates para utilizar ao criar o Eitri-App")
78
76
  .option("-v, --verbose", "Exibe mais logs")
79
77
  .action(async (projectName, cmdObj) => {
80
78
  return await globalEitriCLIV2.create({
81
79
  ...cmdObj,
82
- projectName
80
+ projectName,
83
81
  });
84
82
  });
85
83
 
@@ -92,21 +90,21 @@ const run = async () => {
92
90
  .option("-sm, --skip-mini-log", "Pula (skip) a conexão com o mini-log")
93
91
  .option(
94
92
  "-p, --playground",
95
- "Gera um QR code com a URL de abertura do Eitri Playground"
93
+ "Gera um QR code com a URL de abertura do Eitri Playground",
96
94
  )
97
95
  .option(
98
96
  "-i, --initializationParams <initializationParams>",
99
- "Define os parâmetros de inicialização do Eitri-App \n Depreciado: Utilize --initialization-params"
97
+ "Define os parâmetros de inicialização do Eitri-App \n Depreciado: Utilize --initialization-params",
100
98
  )
101
99
  .option(
102
100
  "-i, --initialization-params <query-params>",
103
- "Define os parâmetros de inicialização do Eitri-App. Ex.: --initialization-params 'foo=bar&hello=world'"
101
+ "Define os parâmetros de inicialização do Eitri-App. Ex.: --initialization-params 'foo=bar&hello=world'",
104
102
  )
105
103
  .option(
106
104
  "-e, --emulator <platform>",
107
- "Abre o Eitri-App no emulador, desde que seja definido qual plataforma será aberto, android ou ios."
105
+ "Abre o Eitri-App no emulador, desde que seja definido qual plataforma será aberto, android ou ios.",
108
106
  )
109
- .option("-sh, --shared", "Executa o Eitri-App no modo compartilhável.")
107
+ .option("-sh, --shared", "Executa o Eitri-App no modo compartilhável.");
110
108
 
111
109
  startProgram.action(async (cmdObj) => {
112
110
  return await globalEitriCLIV2.start(cmdObj);
@@ -115,18 +113,18 @@ const run = async () => {
115
113
  program
116
114
  .command("push-version")
117
115
  .description(
118
- "Cria e envia uma versão do Eitri-App para o Console, possibilitando também publicar em um ambiente."
116
+ "Cria e envia uma versão do Eitri-App para o Console, possibilitando também publicar em um ambiente.",
119
117
  )
120
118
  .option("-l, --local", "Aponta para o servidor local")
121
119
  .option("-v, --verbose", "Exibe mais logs")
122
120
  .option(
123
121
  "-r, --release",
124
- "Gera uma nova release baseado nos commits. Um arquivo CHANGELOG.md será gerado automaticamente."
122
+ "Gera uma nova release baseado nos commits. Um arquivo CHANGELOG.md será gerado automaticamente.",
125
123
  )
126
124
  .option("-s, --shared", "Publica o Eitri-App compartilhado")
127
125
  .option(
128
126
  "-m, --message <revision-message>",
129
- "Adiciona comentários na versão"
127
+ "Adiciona comentários na versão",
130
128
  )
131
129
  .option("-y, --yes", "Aceita automaticamente as respostas do prompt.")
132
130
  .action(async (cmdObj) => {
@@ -136,7 +134,7 @@ const run = async () => {
136
134
  program
137
135
  .command("clean")
138
136
  .description(
139
- "Realiza a limpeza do workspace remoto do desenvolvedor. Útil quando há mal funcionamento na compilação em nuvem do Eitri-App."
137
+ "Realiza a limpeza do workspace remoto do desenvolvedor. Útil quando há mal funcionamento na compilação em nuvem do Eitri-App.",
140
138
  )
141
139
  .option("-v, --verbose", "Exibe mais logs")
142
140
  .action(async (cmdObj) => {
@@ -147,7 +145,7 @@ const run = async () => {
147
145
  .command("self-update")
148
146
  .description("Desinstala a versão antiga e instala a mais nova")
149
147
  .action(async () => {
150
- await globalEitriCLIV2.selfUpdate()
148
+ await globalEitriCLIV2.selfUpdate();
151
149
  });
152
150
 
153
151
  program
@@ -162,7 +160,7 @@ const run = async () => {
162
160
  program
163
161
  .command("doctor")
164
162
  .description(
165
- "Valida as dependências externas para execução da CLI do Eitri"
163
+ "Valida as dependências externas para execução da CLI do Eitri",
166
164
  )
167
165
  .action(async (cmdObj) => {
168
166
  return await globalEitriCLIV2.doctor();
@@ -173,12 +171,12 @@ const run = async () => {
173
171
  .description("Publica a versão atual no environment selecionado.")
174
172
  .option(
175
173
  "-e, --environment <environment>",
176
- "Define o environment que publicará a versão atual presente no eitri-conf"
174
+ "Define o environment que publicará a versão atual presente no eitri-conf",
177
175
  )
178
176
  .option("-m, --message <publish-message>", "Adiciona comentários na versão")
179
177
  .action(async (cmdObj) => {
180
178
  if (!cmdObj.environment) {
181
- console.error("Argumento --environment <id> é obrigatório.")
179
+ console.error("Argumento --environment <id> é obrigatório.");
182
180
  return;
183
181
  }
184
182
  await globalEitriCLIV2.publish(cmdObj);
@@ -188,10 +186,13 @@ const run = async () => {
188
186
  .command("test")
189
187
  .description("Executa os testes do eitri-app.")
190
188
  .option("-v, --verbose", "Exibe mais logs")
191
- .option("-w, --watch", "Observa a alteração dos arquivos e executa os testes novamente a cada alteração")
189
+ .option(
190
+ "-w, --watch",
191
+ "Observa a alteração dos arquivos e executa os testes novamente a cada alteração",
192
+ )
192
193
  .option(
193
194
  "-p --path <test_path>",
194
- "Define o path do arquivo de teste que será executado."
195
+ "Define o path do arquivo de teste que será executado.",
195
196
  )
196
197
  .action(async (cmdObj) => {
197
198
  return await globalEitriCLIV2.runTest(cmdObj);
@@ -199,9 +200,7 @@ const run = async () => {
199
200
 
200
201
  program
201
202
  .command("gpt")
202
- .description(
203
- "Fornece um prompt para geração de Views com o Eitri-GPT."
204
- )
203
+ .description("Fornece um prompt para geração de Views com o Eitri-GPT.")
205
204
  .action(async (cmdObj) => {
206
205
  return await globalEitriCLIV2.gpt();
207
206
  });
@@ -215,9 +214,7 @@ const run = async () => {
215
214
  !program.commands.map((cmd) => cmd._name).includes(process.argv[2])
216
215
  ) {
217
216
  if (!process.argv[2].startsWith("-")) {
218
- console.log(
219
- `\n ${emoji.lib.rotating_light.char} Comando ${process.argv[2]} inexistente.\n`
220
- );
217
+ console.log(`\n 🚨 Comando ${process.argv[2]} inexistente.\n`);
221
218
  program.help();
222
219
  }
223
220
  }
package/package.json CHANGED
@@ -1,46 +1,43 @@
1
1
  {
2
- "name": "eitri-cli",
3
- "version": "1.50.0",
4
- "description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
5
- "main": "index.js",
6
- "bin": {
7
- "eitri": "index-eitri.js"
8
- },
9
- "scripts": {
10
- "test-eitri": "NODE_APP_INSTANCE=eitri jest --detectOpenHandles",
11
- "test": "NODE_APP_INSTANCE=eitri jest --detectOpenHandles",
12
- "linter": "./node_modules/.bin/eslint --fix ./src/**/*.js",
13
- "docsify:run": "cd docsify && docsify serve",
14
- "build": "echo \"no build\"",
15
- "release": "semantic-release",
16
- "release:dry": "semantic-release --dry-run",
17
- "prepare": "husky install"
18
- },
19
- "engines": {
20
- "node": ">=16.0.0",
21
- "npm": ">=3.0.0"
22
- },
23
- "keywords": [],
24
- "author": "Calindra",
25
- "license": "ISC",
26
- "dependencies": {
27
- "axios": "1.12.2",
28
- "commander": "9.2.0",
29
- "debug": "4.4.0",
30
- "emojilib": "2.4.0",
31
- "semver": "7.7.0",
32
- "uuid": "7.0.2"
33
- },
34
- "devDependencies": {
35
- "@commitlint/cli": "17.7.2",
36
- "@commitlint/config-conventional": "17.7.0",
37
- "@faker-js/faker": "7.6.0",
38
- "@semantic-release/changelog": "6.0.3",
39
- "@semantic-release/git": "10.0.1",
40
- "husky": "8.0.3",
41
- "jest": "29.7.0",
42
- "lint-staged": "9.5.0",
43
- "playwright": "1.55.0",
44
- "semantic-release": "22.0.8"
45
- }
2
+ "name": "eitri-cli",
3
+ "version": "1.51.0-beta.1",
4
+ "description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "eitri": "index-eitri.js"
8
+ },
9
+ "scripts": {
10
+ "test-eitri": "NODE_APP_INSTANCE=eitri jest --detectOpenHandles",
11
+ "test": "NODE_APP_INSTANCE=eitri jest --detectOpenHandles",
12
+ "linter": "./node_modules/.bin/eslint --fix ./src/**/*.js",
13
+ "docsify:run": "cd docsify && docsify serve",
14
+ "build": "echo \"no build\"",
15
+ "release": "semantic-release",
16
+ "release:dry": "semantic-release --dry-run",
17
+ "prepare": "husky install"
18
+ },
19
+ "engines": {
20
+ "node": ">=16.0.0",
21
+ "npm": ">=3.0.0"
22
+ },
23
+ "keywords": [],
24
+ "author": "Calindra",
25
+ "license": "ISC",
26
+ "dependencies": {
27
+ "commander": "9.2.0",
28
+ "uuid": "7.0.2"
29
+ },
30
+ "devDependencies": {
31
+ "@commitlint/cli": "17.7.2",
32
+ "@commitlint/config-conventional": "17.7.0",
33
+ "@faker-js/faker": "7.6.0",
34
+ "@semantic-release/changelog": "6.0.3",
35
+ "@semantic-release/git": "10.0.1",
36
+ "axios": "1.13.6",
37
+ "husky": "8.0.3",
38
+ "jest": "29.7.0",
39
+ "lint-staged": "9.5.0",
40
+ "playwright": "1.58.2",
41
+ "semantic-release": "25.0.3"
42
+ }
46
43
  }
package/.husky/pre-commit DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- cd ./eitri-cli-v2 && cargo clippy
package/.releaserc.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "branches": [
3
- "master",
4
- {
5
- "name": "beta",
6
- "prerelease": true
7
- }
8
- ],
9
- "plugins": [
10
- "@semantic-release/commit-analyzer",
11
- "@semantic-release/release-notes-generator",
12
- "@semantic-release/npm",
13
- "@semantic-release/git",
14
- [
15
- "@semantic-release/changelog",
16
- {
17
- "changelogFile": "CHANGELOG.md"
18
- }
19
- ],
20
- [
21
- "@semantic-release/git",
22
- {
23
- "assets": [
24
- "CHANGELOG.md",
25
- "package.json"
26
- ],
27
- "message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
28
- }
29
- ]
30
- ]
31
- }
@@ -1,33 +0,0 @@
1
- {
2
- "cSpell.words": [
3
- "artem",
4
- "ascii",
5
- "bifrost",
6
- "crossterm",
7
- "deeplink",
8
- "development_deeplink",
9
- "developmentDeeplink",
10
- "dialoguer",
11
- "eitri",
12
- "github",
13
- "httpmock",
14
- "hugin",
15
- "luminus",
16
- "meitri",
17
- "miniapp",
18
- "napi",
19
- "releaserc",
20
- "reqwest",
21
- "socketio",
22
- "sysinfo",
23
- "tokio",
24
- "Unmocked",
25
- "uuid",
26
- "vegvisir",
27
- "Vegvisir",
28
- "walkdir",
29
- "webbrowser"
30
- ],
31
- "rust-analyzer.showUnlinkedFileNotification": false,
32
- "cSpell.language": "en,pt,pt-BR"
33
- }
@@ -1,163 +0,0 @@
1
- image:
2
- name: 343482176926.dkr.ecr.us-east-1.amazonaws.com/eitri-base-cli-pipeline:latest
3
- aws:
4
- access-key: $EITRI_PROD_AWS_ACCESS_KEY_ID
5
- secret-key: $EITRI_PROD_AWS_SECRET_ACCESS_KEY
6
- options:
7
- size: 8x
8
- pipelines:
9
- custom:
10
- test-validation:
11
- - step:
12
- name: Run validation tests
13
- caches:
14
- - node
15
- script:
16
- - apt-get update && apt-get install -y dnsutils
17
- - dig +short ns eitri.tech
18
- - cd eitri-cli-v2
19
- - npm i
20
- - npx playwright@1.55.0 install firefox
21
- - npm run build:debug
22
- - cd ..
23
- - npm i
24
- - npm i -g .
25
- - export FOUNDRY_CONTEXT_PATH=runes-foundry
26
- - npm run test cli.test.js -- --force-exit
27
- default:
28
- - step: &runTests
29
- name: Run tests
30
- caches:
31
- - node
32
- script:
33
- - apt-get update && apt-get install -y dnsutils
34
- - dig +short ns eitri.tech
35
- - cd eitri-cli-v2
36
- - npm i
37
- - npx playwright@1.55.0 install firefox
38
- - npm run build:debug
39
- - cd ..
40
- - npm i
41
- - npm i -g .
42
- - export FOUNDRY_CONTEXT_PATH=runes-foundry
43
- - npm run test cli.test.js -- --force-exit --runInBand --bail
44
- - step: &runRustTests
45
- name: Run Rust tests
46
- caches:
47
- - node
48
- script:
49
- - apt-get update
50
- - cd eitri-cli-v2
51
- - npm i
52
- - npm run build:debug
53
- - cd ..
54
- - npm i
55
- - npm i -g .
56
- - mkdir -p ~/.eitri/workspaces
57
- - cp -r eitri-cli-v2/tests/fixtures/fake-workspace ~/.eitri/workspaces/workspace
58
- - cd eitri-cli-v2
59
- - cargo clippy
60
- - cargo test -- --test-threads=1 --nocapture
61
- - step: &macOSCrossCompileArm
62
- image:
63
- name: 343482176926.dkr.ecr.us-east-1.amazonaws.com/eitri-base-cli-pipeline:macos
64
- aws:
65
- access-key: $EITRI_PROD_AWS_ACCESS_KEY_ID
66
- secret-key: $EITRI_PROD_AWS_SECRET_ACCESS_KEY
67
- name: "macOS cross compile ARM"
68
- caches:
69
- - node
70
- script:
71
- - cd eitri-cli-v2
72
- - cargo add openssl --features vendored
73
- - npm install
74
- - npm run build -- --target aarch64-apple-darwin
75
- - rm -rf target
76
- - cp -r ./eitri-cli-v2.darwin-arm64.node ../eitri-cli-v2.darwin-arm64.node
77
- artifacts:
78
- - eitri-cli-v2.darwin-arm64.node
79
- - step: &macOSCrossCompileX86_64
80
- image:
81
- name: 343482176926.dkr.ecr.us-east-1.amazonaws.com/eitri-base-cli-pipeline:macos
82
- aws:
83
- access-key: $EITRI_PROD_AWS_ACCESS_KEY_ID
84
- secret-key: $EITRI_PROD_AWS_SECRET_ACCESS_KEY
85
- name: "macOS cross compile x86_64"
86
- caches:
87
- - node
88
- script:
89
- - cd eitri-cli-v2
90
- - cargo add openssl --features vendored
91
- - npm install
92
- - npm run build -- --target x86_64-apple-darwin
93
- - rm -rf target
94
- - cp -r ./eitri-cli-v2.darwin-x64.node ../eitri-cli-v2.darwin-x64.node
95
- - cp -r ./index.d.ts ../index.d.ts
96
- - cp -r ./index.js ../rust-index.js
97
- artifacts:
98
- - eitri-cli-v2.darwin-x64.node
99
- - index.d.ts
100
- - rust-index.js
101
- - step: &linuxCrossCompile
102
- caches:
103
- - node
104
- name: 'Linux compile'
105
- script:
106
- - rustup target add x86_64-unknown-linux-gnu
107
- - cd eitri-cli-v2
108
- - cargo add openssl --features vendored
109
- - npm install
110
- - npm run build -- --target x86_64-unknown-linux-gnu
111
- - cp -r ./eitri-cli-v2.linux-x64-gnu.node ../eitri-cli-v2.linux-x64-gnu.node
112
- artifacts:
113
- - eitri-cli-v2.linux-x64-gnu.node
114
- - step: &windowsCrossCompile
115
- caches:
116
- - node
117
- name: 'Windows cross compile'
118
- script:
119
- - apt-get install -y mingw-w64
120
- - rustup target add x86_64-pc-windows-msvc
121
- - cargo install --locked --version 0.18.6 cargo-xwin
122
- - cd eitri-cli-v2
123
- - npm install
124
- - npm run build -- --target x86_64-pc-windows-msvc
125
- - cp -r ./eitri-cli-v2.win32-x64-msvc.node ../eitri-cli-v2.win32-x64-msvc.node
126
- artifacts:
127
- - eitri-cli-v2.win32-x64-msvc.node
128
- branches:
129
- "**":
130
- - parallel:
131
- fail-fast: false
132
- steps:
133
- - step: *runTests
134
- - step: *runRustTests
135
- '{beta,master}':
136
- - parallel:
137
- fail-fast: true
138
- steps:
139
- - step: *runTests
140
- - step: *runRustTests
141
- - step: *windowsCrossCompile
142
- - step: *linuxCrossCompile
143
- - step: *macOSCrossCompileArm
144
- - step: *macOSCrossCompileX86_64
145
- - step:
146
- name: "Generation of a new version: beta or stable."
147
- caches:
148
- - node
149
- script:
150
- - mv ./eitri-cli-v2.darwin-arm64.node ./eitri-cli-v2/eitri-cli-v2.darwin-arm64.node
151
- - mv ./eitri-cli-v2.darwin-x64.node ./eitri-cli-v2/eitri-cli-v2.darwin-x64.node
152
- - mv ./eitri-cli-v2.linux-x64-gnu.node ./eitri-cli-v2/eitri-cli-v2.linux-x64-gnu.node
153
- - mv ./eitri-cli-v2.win32-x64-msvc.node ./eitri-cli-v2/eitri-cli-v2.win32-x64-msvc.node
154
- - mv ./index.d.ts ./eitri-cli-v2/index.d.ts
155
- - mv ./rust-index.js ./eitri-cli-v2/index.js
156
- - echo 'Start release'
157
- - echo 'If there is a new version, it will be automatically published on NPM according to the channel/branch (beta or master (stable)).'
158
- - npm i
159
- - npm run release
160
- - RELEASE_VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
161
- - node -e "const fs = require('fs'); const packageJson = JSON.parse(fs.readFileSync('package.json')); packageJson.version = process.env.RELEASE_VERSION; fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 4));"
162
- - echo 'New release'
163
- - echo $RELEASE_VERSION