From 07eb320b4fac47a1c6d13c6173f89cd202e0e533 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Thu, 12 Jun 2025 12:03:19 -0600 Subject: [PATCH] ci: switch to `ubuntu-24.04` runner Signed-off-by: Matthew Penner --- .github/workflows/build.yaml | 10 ++++--- .github/workflows/ci.yaml | 16 ++++++---- .github/workflows/docker.yaml | 17 ++++++----- .github/workflows/lint.yaml | 6 ++-- .github/workflows/release.yaml | 53 ++++++++++++---------------------- 5 files changed, 49 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4aca84ce8..6874f7f20 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,20 +13,22 @@ on: jobs: ui: name: UI - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 + permissions: + contents: read strategy: fail-fast: false matrix: node-version: [16] steps: - name: Code Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" + cache: yarn - name: Install dependencies run: yarn install --frozen-lockfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3bf5d9ecf..9bfaf70a8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,12 +13,19 @@ on: jobs: tests: name: Tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 + permissions: + contents: read strategy: fail-fast: false matrix: php: [8.2, 8.3] - database: ["mariadb:10.2", "mysql:8"] + database: + - mariadb:10.5 + - mariadb:10.11 + - mariadb:11.5 + - mysql:8 + - mysql:9 services: database: image: ${{ matrix.database }} @@ -27,10 +34,9 @@ jobs: MYSQL_DATABASE: testing ports: - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Code Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get cache directory id: composer-cache @@ -38,7 +44,7 @@ jobs: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index d9e824096..86db283f8 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -16,15 +16,18 @@ on: jobs: push: name: Push - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))" + permissions: + contents: read + packages: write steps: - name: Code checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker metadata id: docker_meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ghcr.io/pterodactyl/panel flavor: | @@ -35,13 +38,13 @@ jobs: type=ref,event=branch - name: Setup QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Setup Docker buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 if: "github.event_name != 'pull_request'" with: registry: ghcr.io @@ -56,7 +59,7 @@ jobs: sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:1}',/" config/app.php - name: Build and Push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 68299f21d..44571e55d 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,10 +13,12 @@ on: jobs: lint: name: Lint - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 + permissions: + contents: read steps: - name: Code Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cbbb4b05e..fa8f29b81 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,16 +8,18 @@ on: jobs: release: name: Release - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 + permissions: + contents: write # write is required to create releases and push. steps: - name: Code checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 - cache: "yarn" + cache: yarn - name: Install dependencies run: yarn install --frozen-lockfile @@ -29,19 +31,19 @@ jobs: env: REF: ${{ github.ref }} run: | - BRANCH=release/${REF:10} - git config --local user.email "ci@pterodactyl.io" - git config --local user.name "Pterodactyl CI" - git checkout -b $BRANCH - git push -u origin $BRANCH + BRANCH=release/"${REF:10}" + git config --local user.email 'ci@pterodactyl.io' + git config --local user.name 'Pterodactyl CI' + git checkout -b "$BRANCH" + git push -u origin "$BRANCH" sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php git add config/app.php - git commit -m "ci(release): bump version" + git commit -m 'ci(release): bump version' git push - name: Create release archive run: | - rm -rf node_modules tests CODE_OF_CONDUCT.md CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix + rm -rf node_modules tests CODE_OF_CONDUCT.md CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix tar -czf panel.tar.gz * .editorconfig .env.example .eslintignore .eslintrc.js .gitignore .prettierrc.json - name: Extract changelog @@ -54,36 +56,17 @@ jobs: run: | SUM=`sha256sum panel.tar.gz` echo -e "\n#### SHA256 Checksum\n\n\`\`\`\n$SUM\n\`\`\`\n" >> ./RELEASE_CHANGELOG - echo $SUM > checksum.txt + echo "$SUM" > checksum.txt - name: Create release id: create_release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: draft: true prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} body_path: ./RELEASE_CHANGELOG - - - name: Upload release archive - id: upload-release-archive - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: panel.tar.gz - asset_name: panel.tar.gz - asset_content_type: application/gzip - - - name: Upload release checksum - id: upload-release-checksum - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./checksum.txt - asset_name: checksum.txt - asset_content_type: text/plain + files: | + panel.tar.gz + checksum.txt