2022-10-14 16:59:20 +00:00
|
|
|
name: Release
|
|
|
|
|
2020-07-05 00:36:07 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2022-10-26 16:43:05 +00:00
|
|
|
- "v*"
|
2022-10-14 16:59:20 +00:00
|
|
|
|
2020-07-05 00:36:07 +00:00
|
|
|
jobs:
|
|
|
|
release:
|
2022-10-14 16:59:20 +00:00
|
|
|
name: Release
|
2020-07-05 00:36:07 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2022-12-05 00:40:17 +00:00
|
|
|
- name: Code checkout
|
2022-10-14 16:59:20 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
2020-07-05 00:36:07 +00:00
|
|
|
with:
|
2022-10-14 16:59:20 +00:00
|
|
|
node-version: 16
|
2022-10-26 16:43:05 +00:00
|
|
|
cache: "yarn"
|
2022-10-14 16:59:20 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: yarn build:production
|
2020-11-15 04:01:02 +00:00
|
|
|
|
2020-07-05 00:36:07 +00:00
|
|
|
- name: Create release branch and bump version
|
|
|
|
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
|
|
|
|
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php
|
|
|
|
git add config/app.php
|
2022-12-05 16:58:13 +00:00
|
|
|
git commit -m "ci(release): bump version"
|
2020-07-05 00:36:07 +00:00
|
|
|
git push
|
|
|
|
|
|
|
|
- name: Create release archive
|
|
|
|
run: |
|
2022-12-05 16:58:13 +00:00
|
|
|
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
|
2020-07-05 00:36:07 +00:00
|
|
|
|
|
|
|
- name: Extract changelog
|
|
|
|
env:
|
|
|
|
REF: ${{ github.ref }}
|
|
|
|
run: |
|
|
|
|
sed -n "/^## ${REF:10}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG
|
|
|
|
|
|
|
|
- name: Create checksum and add to changelog
|
|
|
|
run: |
|
|
|
|
SUM=`sha256sum panel.tar.gz`
|
|
|
|
echo -e "\n#### SHA256 Checksum\n\n\`\`\`\n$SUM\n\`\`\`\n" >> ./RELEASE_CHANGELOG
|
|
|
|
echo $SUM > checksum.txt
|
|
|
|
|
2022-12-05 00:40:17 +00:00
|
|
|
- name: Create release
|
2020-07-05 00:36:07 +00:00
|
|
|
id: create_release
|
2022-12-05 00:40:17 +00:00
|
|
|
uses: softprops/action-gh-release@v1
|
2020-07-05 00:36:07 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
draft: true
|
2022-12-05 00:40:17 +00:00
|
|
|
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
|
|
|
|
body_path: ./RELEASE_CHANGELOG
|
2020-11-15 04:01:02 +00:00
|
|
|
|
2022-10-14 16:59:20 +00:00
|
|
|
- name: Upload release archive
|
2020-07-05 00:36:07 +00:00
|
|
|
id: upload-release-archive
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2020-11-15 04:01:02 +00:00
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2020-07-05 00:36:07 +00:00
|
|
|
asset_path: panel.tar.gz
|
|
|
|
asset_name: panel.tar.gz
|
|
|
|
asset_content_type: application/gzip
|
2020-11-15 04:01:02 +00:00
|
|
|
|
2022-10-14 16:59:20 +00:00
|
|
|
- name: Upload release checksum
|
2020-11-15 04:01:02 +00:00
|
|
|
id: upload-release-checksum
|
2020-07-05 00:36:07 +00:00
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2020-11-15 04:01:02 +00:00
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2020-07-05 00:36:07 +00:00
|
|
|
asset_path: ./checksum.txt
|
|
|
|
asset_name: checksum.txt
|
|
|
|
asset_content_type: text/plain
|