This commit is contained in:
parent
9bf5071842
commit
b1c531861e
1 changed files with 26 additions and 4 deletions
|
|
@ -22,12 +22,17 @@ jobs:
|
||||||
chmod +x convertir.sh
|
chmod +x convertir.sh
|
||||||
./convertir.sh
|
./convertir.sh
|
||||||
|
|
||||||
- name: Obtener ultima tag
|
# Opcional: copiar a release-dir lo que vaya a ir como asset
|
||||||
id: get_tag
|
rm -rf release-dir
|
||||||
|
mkdir -p release-dir
|
||||||
|
cp /output/*.html release-dir/ || true
|
||||||
|
|
||||||
|
- name: Obtener última tag
|
||||||
run: |
|
run: |
|
||||||
|
# Esto falla si no hay tags: crea al menos una antes (v0.1.0, etc.)
|
||||||
TAG=$(git describe --tags --abbrev=0)
|
TAG=$(git describe --tags --abbrev=0)
|
||||||
echo "Última tag encontrada: $TAG"
|
echo "Ultima tag encontrada: $TAG"
|
||||||
echo "TAG=$TAG" >> $GITHUB_ENV
|
echo "TAG=$TAG" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Crear release
|
- name: Crear release
|
||||||
env:
|
env:
|
||||||
|
|
@ -36,6 +41,23 @@ jobs:
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
TAG: ${{ env.TAG }}
|
TAG: ${{ env.TAG }}
|
||||||
run: |
|
run: |
|
||||||
|
if [ -z "$TAG" ]; then
|
||||||
|
echo "No hay TAG definida, no creo release"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
JSON_PAYLOAD=$(cat <<EOF
|
||||||
|
{
|
||||||
|
"tag_name": "${TAG}",
|
||||||
|
"name": "Release ${TAG}",
|
||||||
|
"body": "Release automatico",
|
||||||
|
"draft": false,
|
||||||
|
"prerelease": false
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
echo "Creando release para tag: ${TAG}"
|
||||||
|
|
||||||
RESPONSE=$(curl -s -X POST \
|
RESPONSE=$(curl -s -X POST \
|
||||||
-H "Authorization: token ${TOKEN}" \
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue