mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-01 03:45:53 -05:00
67 lines
2.5 KiB
YAML
67 lines
2.5 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
jobs:
|
|
# A release is only built once the install guide works on every supported system.
|
|
install:
|
|
uses: ./.github/workflows/install.yaml
|
|
permissions:
|
|
contents: read
|
|
|
|
release:
|
|
name: Release
|
|
needs: install
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run tsc
|
|
- run: npm run build:production
|
|
- name: create release branch and bump version
|
|
env:
|
|
VERSION: ${{ github.ref_name }}
|
|
run: |
|
|
BRANCH=release/${{ env.VERSION }}
|
|
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/'canary'/'${VERSION:1}'/" config/app.php
|
|
git add config/app.php
|
|
git commit -m 'ci(release): bump version'
|
|
git push
|
|
- name: create release archive
|
|
run: bash .github/scripts/archive.sh
|
|
- name: write changelog
|
|
run: |
|
|
sed -n "/^## ${{ github.ref_name }}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG
|
|
- uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
draft: true
|
|
prerelease: ${{ contains(github.ref_name, 'rc') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
|
|
body_path: ./RELEASE_CHANGELOG
|
|
files: |
|
|
panel.tar.gz
|
|
|
|
# Publishes the tagged version to https://cdn.pterodactyl.io/releases/latest.json
|
|
# through pterodactyl/pterodactyl-cdn, which every panel polls for updates.
|
|
- name: Update CDN release manifest
|
|
if: ${{ !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'beta') && !contains(github.ref_name, 'alpha') }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.CDN_DISPATCH_TOKEN }}
|
|
VERSION: ${{ github.ref_name }}
|
|
run: |
|
|
jq -n --arg version "$VERSION" \
|
|
'{event_type: "release-tagged", client_payload: {component: "panel", version: $version}}' \
|
|
| gh api repos/pterodactyl/pterodactyl-cdn/dispatches --input -
|