release + html 6
This commit is contained in:
parent
3171fa1363
commit
fe9cf12d4f
1 changed files with 23 additions and 31 deletions
|
|
@ -6,7 +6,7 @@ on:
|
|||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-22.04
|
||||
volumes:
|
||||
|
|
@ -14,64 +14,56 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Convertir y desplegar
|
||||
shell: bash
|
||||
run: |
|
||||
chmod +x convertir.sh
|
||||
./convertir.sh
|
||||
|
||||
./convertir.sh
|
||||
|
||||
- name: Obtener última tag
|
||||
run: |
|
||||
id: get_tag
|
||||
run: |
|
||||
TAG=$(git describe --tags --abbrev=0)
|
||||
echo "TAG=${TAG}" >> $GITHUB_ENV
|
||||
echo "Última tag encontrada: $TAG"
|
||||
echo "TAG=$TAG" >> $GITHUB_ENV
|
||||
|
||||
- name: Crear release
|
||||
env:
|
||||
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
FORGEJO_API: ${{ github.api_url }}
|
||||
REPO: ${{ github.repository }}
|
||||
TAG: ${{ env.TAG }}
|
||||
run: |
|
||||
TAG="${env.TAG}"
|
||||
|
||||
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 \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "${JSON_PAYLOAD}" \
|
||||
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases")
|
||||
|
||||
"${FORGEJO_API}/repos/${REPO}/releases")
|
||||
|
||||
echo "Respuesta: ${RESPONSE}"
|
||||
|
||||
|
||||
RELEASE_ID=$(echo "${RESPONSE}" | jq -r '.id')
|
||||
|
||||
|
||||
if [ "${RELEASE_ID}" = "null" ] || [ -z "${RELEASE_ID}" ]; then
|
||||
echo "Error creando release"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
echo "Release creado con ID: ${RELEASE_ID}"
|
||||
|
||||
|
||||
for FILE in release-dir/*; do
|
||||
[ -e "$FILE" ] || continue
|
||||
FILENAME=$(basename "${FILE}")
|
||||
echo "Subiendo ${FILENAME}..."
|
||||
|
||||
curl -X POST \
|
||||
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"${FILE}" \
|
||||
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${FILENAME}"
|
||||
"${FORGEJO_API}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${FILENAME}"
|
||||
done
|
||||
|
||||
|
||||
echo "Release completado correctamente"
|
||||
Loading…
Reference in a new issue