mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 19:46:18 +00:00
87 lines
2.4 KiB
YAML
87 lines
2.4 KiB
YAML
name: Build ProxMenux Monitor AppImage
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths: [ 'AppImage/**' ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths: [ 'AppImage/**' ]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install dependencies
|
|
working-directory: AppImage
|
|
run: npm install --legacy-peer-deps
|
|
|
|
- name: Build Next.js app
|
|
working-directory: AppImage
|
|
run: npm run build
|
|
|
|
- name: Install Python dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y python3 python3-pip python3-venv
|
|
|
|
- name: Make build script executable
|
|
working-directory: AppImage
|
|
run: chmod +x scripts/build_appimage.sh
|
|
|
|
- name: Build AppImage
|
|
working-directory: AppImage
|
|
run: ./scripts/build_appimage.sh
|
|
|
|
- name: Get version from package.json
|
|
id: version
|
|
working-directory: AppImage
|
|
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
|
|
- name: Upload AppImage artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ProxMenux-${{ steps.version.outputs.VERSION }}-AppImage
|
|
path: AppImage/dist/*.AppImage
|
|
retention-days: 30
|
|
|
|
- name: Generate SHA256 checksum
|
|
run: |
|
|
cd AppImage/dist
|
|
sha256sum *.AppImage > ProxMenux-Monitor.AppImage.sha256
|
|
echo "Generated SHA256:"
|
|
cat ProxMenux-Monitor.AppImage.sha256
|
|
|
|
- name: Upload AppImage and checksum to /AppImage folder in main
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
git fetch origin main
|
|
git checkout main
|
|
|
|
rm -f AppImage/*.AppImage AppImage/*.sha256 || true
|
|
|
|
# Copy new files
|
|
cp AppImage/dist/*.AppImage AppImage/
|
|
cp AppImage/dist/ProxMenux-Monitor.AppImage.sha256 AppImage/
|
|
|
|
git add AppImage/*.AppImage AppImage/*.sha256
|
|
git commit -m "Update AppImage build ($(date +'%Y-%m-%d %H:%M:%S'))" || echo "No changes to commit"
|
|
git push origin main
|