diff --git a/.github/scripts/archive.sh b/.github/scripts/archive.sh new file mode 100755 index 000000000..14f1af6ec --- /dev/null +++ b/.github/scripts/archive.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# Packs the release archive from a checkout whose frontend is already built. +set -euo pipefail + +rm -rf node_modules tests CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix +tar -czf panel.tar.gz * .editorconfig .env.example .gitignore .oxfmtrc.json diff --git a/.github/workflows/install.yaml b/.github/workflows/install.yaml index 3dc7a7fdd..56a576d0e 100644 --- a/.github/workflows/install.yaml +++ b/.github/workflows/install.yaml @@ -42,8 +42,30 @@ jobs: - run: npm ci - run: npm run build:production + archive: + name: Release archive + runs-on: ubuntu-24.04 + permissions: + contents: read + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 22 + cache: npm + - run: npm ci + - run: npm run build:production + # The same archive a release publishes, which the install guide downloads. + - run: bash .github/scripts/archive.sh + - uses: actions/upload-artifact@v7 + with: + name: panel + path: panel.tar.gz + retention-days: 1 + install: name: ${{ matrix.os }} + needs: archive runs-on: ubuntu-24.04 timeout-minutes: 30 permissions: @@ -94,28 +116,17 @@ jobs: - name: Install Composer run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer - - name: Install Node.js - run: | - curl -fsSL https://deb.nodesource.com/setup_22.x | bash - - apt -y install nodejs - - - uses: actions/checkout@v7 + - uses: actions/download-artifact@v8 with: - path: panel + name: panel - - name: Move the panel into place + - name: Download the Panel run: | mkdir -p /var/www/pterodactyl - cp -a panel/. /var/www/pterodactyl/ + tar -xzf panel.tar.gz -C /var/www/pterodactyl cd /var/www/pterodactyl chmod -R 755 storage/* bootstrap/cache/ - - name: Build the frontend - working-directory: /var/www/pterodactyl - run: | - npm ci - npm run build:production - - name: Start MariaDB and Redis run: | mkdir -p /run/mysqld && chown mysql:mysql /run/mysqld diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fd7da7fc1..87db7d353 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,9 +39,7 @@ jobs: git commit -m 'ci(release): bump version' git push - name: create release archive - run: | - rm -rf node_modules tests CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix - tar -czf panel.tar.gz * .editorconfig .env.example .gitignore .oxfmtrc.json + run: bash .github/scripts/archive.sh - name: write changelog run: | sed -n "/^## ${{ github.ref_name }}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG