Skip to content

Commit

Permalink
🐛 fix(all): fix enviroment project
Browse files Browse the repository at this point in the history
  • Loading branch information
Ángel Albiñana Espejo authored and Ángel Albiñana Espejo committed Aug 20, 2024
1 parent f14a5cf commit 31bc152
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 254 deletions.
2 changes: 1 addition & 1 deletion .dev/push.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ await execProcess( {
origin : 'origin',
workflow : 'workflow',
}
const cache = initCache( {
const cache = await initCache( {
id : 'push',
values : {
[data.add] : '.',
Expand Down
2 changes: 1 addition & 1 deletion .dev/todo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ await execProcess( {
selectedFile : 'selectedFile',
showInConsole : 'showInConsole',
}
const cache = initCache( {
const cache = await initCache( {
id : 'todo',
values : {
[data.selectedFile] : fileNames[0],
Expand Down
6 changes: 3 additions & 3 deletions .dev/workflow.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {

const getAppVersion = async () => {

const packageJsonPath = paths.appPkg
const packageJsonPath = paths.libPkg
const packageJson = await readJSON( packageJsonPath )
return packageJson.version

Expand All @@ -38,7 +38,7 @@ await execProcess( {
on : async ( { log } ) => {

const fileNames = await getFilteredFileNames( {
path : paths.worksflowsDir,
path : paths.workflowsDir,
extensions : [
'.yml',
],
Expand All @@ -48,7 +48,7 @@ await execProcess( {
file : 'file',
inputs : 'inputs',
}
const cache = initCache( {
const cache = await initCache( {
id : 'workflow',
values : {
[data.file] : fileNames[0],
Expand Down
34 changes: 2 additions & 32 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,45 +160,15 @@ jobs:
inputs: '{ "version": "${{ steps.updated.outputs.docs_version }}"}'
continue-on-error: true

- name: 💾🐙😺➡️ Call to workflow for create binary releases
if: steps.updated.outputs.core_version != ''
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release-bins.yml
inputs: '{ "version": "${{ steps.updated.outputs.core_version }}"}'
continue-on-error: true

- name: 🖥️🐙😺➡️ Call to workflow for create app releases
if: steps.updated.outputs.core_version != ''
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release-app.yml
inputs: '{ "version": "${{ steps.updated.outputs.core_version }}"}'
continue-on-error: true

# - name: 🖥️🐙😺➡️ Call to workflow for create LINUX ARM64 app releases
# - name: 💾🐙😺➡️ Call to workflow for create lib releases
# if: steps.updated.outputs.core_version != ''
# uses: benc-uk/workflow-dispatch@v1
# with:
# workflow: release-app-linux-arm.yml
# workflow: release-lib.yml
# inputs: '{ "version": "${{ steps.updated.outputs.core_version }}"}'
# continue-on-error: true

- name: 🤖🐙😺➡️ Call to workflow for create Github action
if: steps.updated.outputs.core_version != ''
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release-action.yml
inputs: '{ "version": "${{ steps.updated.outputs.core_version }}"}'
continue-on-error: true

- name: 🐳🐙😺➡️ Call to workflow for create container releases
if: steps.updated.outputs.core_version != ''
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release-container.yml
inputs: '{ "version": "${{ steps.updated.outputs.core_version }}"}'
continue-on-error: true


###############################################################################
213 changes: 0 additions & 213 deletions .github/workflows/release-lib.yml

This file was deleted.

13 changes: 11 additions & 2 deletions packages/_config/src/core/cache.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
// @ts-nocheck
import Conf from 'conf'
import { paths } from './const.mjs'
import { readJSON } from './fs.mjs'

export const initCache = ( { id, values, cached = true } ) => {
export const initCache = async ( { id, values, cached = true } ) => {
const getAppName = async () => {

const packageJsonPath = paths.libPkg
const packageJson = await readJSON( packageJsonPath )
return packageJson.name

}
const name = await getAppName()
// Crear una instancia de Conf, se utilizará id como clave de configuración base.
const config = new Conf( {
projectName : 'bepp-dev',
projectName : name+ '-dev',
} )

return {
Expand Down
4 changes: 2 additions & 2 deletions packages/_config/src/core/const.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {

const workspaceDir = pkg.dir
const workspacePkg = joinPath( workspaceDir, 'package.json' )
const worksflowsDir = joinPath( workspaceDir, '.github', 'workflows' )
const workflowsDir = joinPath( workspaceDir, '.github', 'workflows' )
const packagesDir = joinPath( workspaceDir, 'packages' )
const tempDir = joinPath( workspaceDir, '__temp__' )
const documentationDir = joinPath( workspaceDir, 'docs' )
Expand Down Expand Up @@ -44,7 +44,7 @@ export const paths = {
workspaceDir,
workspacePkg,
packagesDir,
worksflowsDir,
workflowsDir,
documentationDir,
todoDir,
devDir,
Expand Down

0 comments on commit 31bc152

Please sign in to comment.