Skip to content

se ha solucionado problemas si python estaba desde homebrew [RELEASE] #12

se ha solucionado problemas si python estaba desde homebrew [RELEASE]

se ha solucionado problemas si python estaba desde homebrew [RELEASE] #12

Workflow file for this run

name: Build and Release .deb
on:
push:
branches:
- main
- master
permissions:
contents: write
jobs:
build:
if: contains(github.event.head_commit.message, '[RELEASE]')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install gettext
run: sudo apt-get update && sudo apt-get install -y gettext
- name: Compile translations
run: |
# Compilar traducciones de la carpeta locale al paquete
mkdir -p appinstall/usr/share/locale/en/LC_MESSAGES/
msgfmt locale/en/LC_MESSAGES/appinstall.po -o appinstall/usr/share/locale/en/LC_MESSAGES/appinstall.mo
# También compilar en la carpeta locale raíz por si acaso
msgfmt locale/en/LC_MESSAGES/appinstall.po -o locale/en/LC_MESSAGES/appinstall.mo
- name: Sync source files
run: |
# Aplicación
mkdir -p appinstall/usr/share/appinstall/
cp -r src/ appinstall/usr/share/appinstall/
cp start.py appinstall/usr/share/appinstall/
cp styles.css appinstall/usr/share/appinstall/
cp appimage.png appinstall/usr/share/appinstall/
# Integración del sistema
mkdir -p appinstall/usr/share/applications/
cp es.inled.AppInstall.desktop appinstall/usr/share/applications/
mkdir -p appinstall/usr/share/metainfo/
cp es.inled.AppInstall.metainfo.xml appinstall/usr/share/metainfo/
# Iconos
mkdir -p appinstall/usr/share/icons/hicolor/512x512/apps/
cp es.inled.AppInstall.png appinstall/usr/share/icons/hicolor/512x512/apps/
mkdir -p appinstall/usr/share/pixmaps/
cp es.inled.AppInstall.png appinstall/usr/share/pixmaps/
- name: Set up permissions
run: |
chmod -R 755 appinstall/usr
chmod 755 appinstall/DEBIAN/postinst
chmod 644 appinstall/DEBIAN/control
- name: Build .deb package
run: |
PACKAGE_NAME=$(grep '^Package:' appinstall/DEBIAN/control | cut -d' ' -f2)
VERSION=$(grep '^Version:' appinstall/DEBIAN/control | cut -d' ' -f2)
ARCH=$(grep '^Architecture:' appinstall/DEBIAN/control | cut -d' ' -f2)
DEB_NAME="${PACKAGE_NAME}_${VERSION}_${ARCH}.deb"
dpkg-deb --root-owner-group --build appinstall "$DEB_NAME"
echo "DEB_NAME=$DEB_NAME" >> $GITHUB_ENV
echo "TAG_NAME=v$VERSION" >> $GITHUB_ENV
- name: Install alien
run: sudo apt-get update && sudo apt-get install -y alien
- name: Build .rpm package
run: |
sudo alien --to-rpm --scripts --keep-version "${{ env.DEB_NAME }}"
# Alien converts underscores to hyphens and might change name slightly
RPM_NAME=$(ls *.rpm | head -n 1)
echo "RPM_NAME=$RPM_NAME" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.DEB_NAME }}
${{ env.RPM_NAME }}
tag_name: ${{ env.TAG_NAME }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger APT Repo Update
if: success()
run: |
# URL del paquete recién subido a la release
DEB_URL="https://github.com/${{ github.repository }}/releases/download/${{ env.TAG_NAME }}/${{ env.DEB_NAME }}"
echo "Disparando actualización en InledGroup/apt para $DEB_URL..."
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.APT_REPO_TOKEN }}" \
https://api.github.com/repos/InledGroup/apt/dispatches \
-d "{\"event_type\": \"package_upload\", \"client_payload\": {\"deb_url\": \"$DEB_URL\"}}"