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:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-22.04
|
image: catthehacker/ubuntu:act-22.04
|
||||||
volumes:
|
volumes:
|
||||||
|
|
@ -14,7 +14,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Convertir y desplegar
|
- name: Convertir y desplegar
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
@ -23,34 +23,25 @@ jobs:
|
||||||
./convertir.sh
|
./convertir.sh
|
||||||
|
|
||||||
- name: Obtener última tag
|
- name: Obtener última tag
|
||||||
|
id: get_tag
|
||||||
run: |
|
run: |
|
||||||
TAG=$(git describe --tags --abbrev=0)
|
TAG=$(git describe --tags --abbrev=0)
|
||||||
echo "TAG=${TAG}" >> $GITHUB_ENV
|
echo "Última tag encontrada: $TAG"
|
||||||
|
echo "TAG=$TAG" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Crear release
|
- name: Crear release
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
FORGEJO_API: ${{ github.api_url }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
TAG: ${{ env.TAG }}
|
||||||
run: |
|
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 \
|
RESPONSE=$(curl -s -X POST \
|
||||||
-H "Authorization: token ${TOKEN}" \
|
-H "Authorization: token ${TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "${JSON_PAYLOAD}" \
|
-d "${JSON_PAYLOAD}" \
|
||||||
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases")
|
"${FORGEJO_API}/repos/${REPO}/releases")
|
||||||
|
|
||||||
echo "Respuesta: ${RESPONSE}"
|
echo "Respuesta: ${RESPONSE}"
|
||||||
|
|
||||||
|
|
@ -64,14 +55,15 @@ jobs:
|
||||||
echo "Release creado con ID: ${RELEASE_ID}"
|
echo "Release creado con ID: ${RELEASE_ID}"
|
||||||
|
|
||||||
for FILE in release-dir/*; do
|
for FILE in release-dir/*; do
|
||||||
|
[ -e "$FILE" ] || continue
|
||||||
FILENAME=$(basename "${FILE}")
|
FILENAME=$(basename "${FILE}")
|
||||||
echo "Subiendo ${FILENAME}..."
|
echo "Subiendo ${FILENAME}..."
|
||||||
|
|
||||||
curl -X POST \
|
curl -s -X POST \
|
||||||
-H "Authorization: token ${TOKEN}" \
|
-H "Authorization: token ${TOKEN}" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
--data-binary @"${FILE}" \
|
--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
|
done
|
||||||
|
|
||||||
echo "Release completado correctamente"
|
echo "Release completado correctamente"
|
||||||
Loading…
Reference in a new issue