-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (122 loc) · 5.24 KB
/
Copy pathrelease.yml
File metadata and controls
157 lines (122 loc) · 5.24 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Create Release
on:
push:
tags:
- 'v*'
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get tag version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Creating release for version: $VERSION"
- name: Validate version format
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Error: Tag version must follow semantic versioning (e.g., 0.3.2)"
exit 1
fi
echo "✅ Version format is valid: $VERSION"
- name: Create release directory
run: |
mkdir -p release/integration-alegra-woo
echo "✅ Release directory created"
- name: Copy plugin files
run: |
echo "📦 Copying plugin files..."
# Copiar archivos y directorios principales
cp -r assets release/integration-alegra-woo/
cp -r includes release/integration-alegra-woo/
cp -r lib release/integration-alegra-woo/
# Copiar vendor solo si existe
if [ -d vendor ]; then
cp -r vendor release/integration-alegra-woo/
fi
# Copiar archivos raíz
cp integration-alegra-woo.php release/integration-alegra-woo/
cp readme.txt release/integration-alegra-woo/
echo "✅ Files copied successfully"
- name: Verify plugin structure
run: |
echo "📋 Verifying plugin structure..."
ls -la release/integration-alegra-woo/
# Verificar que existe el archivo principal del plugin
if [ ! -f release/integration-alegra-woo/integration-alegra-woo.php ]; then
echo "❌ Error: Main plugin file not found!"
exit 1
fi
echo "✅ Plugin structure verified"
- name: Create ZIP file
run: |
cd release
zip -r ../integration-alegra-woo.zip integration-alegra-woo/ -x "*.git*" "*.DS_Store"
cd ..
# Verificar que el ZIP se creó correctamente
if [ ! -f integration-alegra-woo.zip ]; then
echo "❌ Error: ZIP file was not created!"
exit 1
fi
# Mostrar tamaño del archivo
ZIP_SIZE=$(du -h integration-alegra-woo.zip | cut -f1)
echo "✅ ZIP created successfully (Size: $ZIP_SIZE)"
- name: Generate changelog from commits
id: changelog
run: |
echo "📝 Generating changelog..."
# Obtener el tag anterior
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -z "$PREV_TAG" ]; then
echo "CHANGELOG=Primera release del plugin" >> $GITHUB_OUTPUT
else
# Generar changelog desde el último tag
CHANGELOG=$(git log $PREV_TAG..HEAD --pretty=format:"- %s" --no-merges)
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ steps.get_version.outputs.VERSION }}
body: |
## 🎉 Integration Alegra WooCommerce v${{ steps.get_version.outputs.VERSION }}
### 📦 Instalación
1. Descarga el archivo `integration-alegra-woo.zip` adjunto abajo
2. Ve a **WordPress** → **Plugins** → **Añadir nuevo** → **Subir plugin**
3. Selecciona el archivo ZIP y haz clic en **"Instalar ahora"**
4. Activa el plugin y configura tus credenciales de Alegra
### 📋 Cambios en esta versión
${{ steps.changelog.outputs.CHANGELOG }}
### ℹ️ Requisitos
- WordPress 6.0 o superior
- WooCommerce 9.6 o superior
- PHP 8.1 o superior
- Plugin: Departamentos y Ciudades de Colombia para WooCommerce
### 📚 Documentación
Para ver el changelog completo y documentación detallada, consulta el archivo `readme.txt` incluido en el plugin.
### 🔗 Enlaces
- [Sitio web del desarrollador](https://saulmoralespa.com)
- [Soporte](https://saulmoralespa.com)
- [LinkedIn](https://www.linkedin.com/in/saulmoralespa/)
---
**Nota**: Este es un plugin para integración con Alegra Colombia. Asegúrate de tener una cuenta activa en Alegra y tus credenciales API antes de instalar.
files: |
integration-alegra-woo.zip
draft: false
prerelease: false
generate_release_notes: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}