fix: configurar repositoryUrl para git push en semantic-release
All checks were successful
CI/CD Semantic Release / release (push) Successful in 4m7s
All checks were successful
CI/CD Semantic Release / release (push) Successful in 4m7s
This commit is contained in:
@@ -12,7 +12,7 @@ jobs:
|
|||||||
- name: Checkout del código
|
- name: Checkout del código
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Descarga todo el historial de Git (vital para semantic-release)
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Preparar entorno Node.js
|
- name: Preparar entorno Node.js
|
||||||
@@ -21,34 +21,41 @@ jobs:
|
|||||||
node-version: '18'
|
node-version: '18'
|
||||||
|
|
||||||
- name: Instalar Semantic Release y Plugins
|
- name: Instalar Semantic Release y Plugins
|
||||||
# Descargamos el motor core y los plugins específicos para Git, Changelog y Gitea
|
run: npm install -D semantic-release @saithodev/semantic-release-gitea @semantic-release/changelog @semantic-release/git @semantic-release/exec
|
||||||
run: |
|
|
||||||
npm install -D semantic-release @saithodev/semantic-release-gitea @semantic-release/changelog @semantic-release/git @semantic-release/exec
|
|
||||||
|
|
||||||
- name: Generar configuración de Release
|
- name: Generar configuración de Release
|
||||||
# Escribimos el archivo de configuración al vuelo
|
env:
|
||||||
|
# Inyectamos el token aquí para poder construir la URL de Git
|
||||||
|
GITEA_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
cat << 'EOF' > .releaserc.json
|
# Construimos la URL de Git con el token incrustado
|
||||||
|
REPO_URL_WITH_TOKEN="https://gitea_actions:${GITEA_TOKEN}@repo.eldiaservicios.com/${{ github.repository }}.git"
|
||||||
|
|
||||||
|
cat << EOF > .releaserc.json
|
||||||
{
|
{
|
||||||
"branches": ["main"],
|
"branches": ["main"],
|
||||||
|
"repositoryUrl": "${REPO_URL_WITH_TOKEN}",
|
||||||
"plugins":[
|
"plugins":[
|
||||||
"@semantic-release/commit-analyzer",
|
"@semantic-release/commit-analyzer",
|
||||||
"@semantic-release/release-notes-generator",
|
"@semantic-release/release-notes-generator",
|
||||||
"@semantic-release/changelog",[
|
"@semantic-release/changelog",
|
||||||
|
[
|
||||||
"@semantic-release/git",
|
"@semantic-release/git",
|
||||||
{
|
{
|
||||||
"assets": ["CHANGELOG.md"],
|
"assets": ["CHANGELOG.md"],
|
||||||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
"message": "chore(release): \${nextRelease.version} [skip ci]\n\n\${nextRelease.notes}"
|
||||||
}
|
}
|
||||||
],[
|
],
|
||||||
|
[
|
||||||
"@saithodev/semantic-release-gitea",
|
"@saithodev/semantic-release-gitea",
|
||||||
{
|
{
|
||||||
"giteaUrl": "https://repo.eldiaservicios.com"
|
"giteaUrl": "https://repo.eldiaservicios.com"
|
||||||
}
|
}
|
||||||
],[
|
],
|
||||||
|
[
|
||||||
"@semantic-release/exec",
|
"@semantic-release/exec",
|
||||||
{
|
{
|
||||||
"successCmd": "echo 'RELEASE_CREATED=true' >> $GITHUB_ENV && echo 'TAG_NAME=${nextRelease.gitTag}' >> $GITHUB_ENV"
|
"successCmd": "echo 'RELEASE_CREATED=true' >> \$GITHUB_ENV && echo 'TAG_NAME=\${nextRelease.gitTag}' >> \$GITHUB_ENV"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -57,14 +64,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Ejecutar Semantic Release
|
- name: Ejecutar Semantic Release
|
||||||
env:
|
env:
|
||||||
|
# Este GITEA_TOKEN es para el plugin de Gitea (crear el release)
|
||||||
GITEA_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
||||||
GITEA_URL: "https://repo.eldiaservicios.com"
|
|
||||||
# Engañamos a Git para que use tu token y tenga permisos de hacer push del CHANGELOG
|
|
||||||
REPOSITORY_URL: "https://gitea_actions:${{ secrets.RELEASE_PLEASE_TOKEN }}@repo.eldiaservicios.com/${{ github.repository }}.git"
|
|
||||||
run: npx semantic-release
|
run: npx semantic-release
|
||||||
|
|
||||||
- name: 🤖 Generar notas épicas con IA Local (Ollama)
|
- name: 🤖 Generar notas con IA Local (Ollama)
|
||||||
# Este paso SOLO se ejecuta si el plugin "exec" de arriba confirmó que hubo un release
|
|
||||||
if: env.RELEASE_CREATED == 'true'
|
if: env.RELEASE_CREATED == 'true'
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user