From f24a741cbb8a3ff0ecb8514743344ee33af1bc00 Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Sun, 5 Jul 2020 02:36:07 +0200 Subject: [PATCH 1/3] add release automation --- .github/workflows/release.yml | 87 +++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..61df3a539 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,87 @@ +name: "Release" + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '12' + + - 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 + git commit -m "bump version for release" + git push + + - name: Build assets + run: | + yarn install + yarn run build:production + + - name: Create release archive + run: | + rm -rf node_modules/ test/ codecov.yml CODE_OF_CONDUCT.md CONTRIBUTING.md phpunit.dusk.xml phpunit.xml Vagrantfile + tar -czf panel.tar.gz * + + - name: Extract changelog + id: extract_changelog + env: + REF: ${{ github.ref }} + run: | + sed -n "/^## ${REF:10}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG + echo ::set-output name=version_name::`sed -nr "s/^## (${REF:10} .*)$/\1/p" CHANGELOG.md` + + - 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 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ steps.extract_changelog.outputs.version_name }} + body_path: ./RELEASE_CHANGELOG + draft: true + prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} + + - name: Upload binary + 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 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 From 2d48781f8e09faa0690fdbc84b608fba95530c45 Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Sun, 5 Jul 2020 03:13:53 +0200 Subject: [PATCH 2/3] disable ci on master and release branches --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 71328ff02..00c37cc59 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,9 @@ name: tests on: push: + branch-ignore: + - 'master' + - 'release/**' pull_request: jobs: integration_tests: From 06ece0e62433278a764a3f29035c7ed656e4b2f9 Mon Sep 17 00:00:00 2001 From: DarthShmev <34663790+DarthShmev@users.noreply.github.com> Date: Sun, 5 Jul 2020 15:48:02 -0400 Subject: [PATCH 3/3] Fix AuthenticateServerAccess middleware spelling issue. --- .../Middleware/Api/Client/Server/AuthenticateServerAccess.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Middleware/Api/Client/Server/AuthenticateServerAccess.php b/app/Http/Middleware/Api/Client/Server/AuthenticateServerAccess.php index 1525755cf..8c10b22d2 100644 --- a/app/Http/Middleware/Api/Client/Server/AuthenticateServerAccess.php +++ b/app/Http/Middleware/Api/Client/Server/AuthenticateServerAccess.php @@ -65,7 +65,7 @@ class AuthenticateServerAccess } if ($server->suspended) { - throw new AccessDeniedHttpException('This server is currenty suspended and the functionality requested is unavailable.'); + throw new AccessDeniedHttpException('This server is currently suspended and the functionality requested is unavailable.'); } if (! $server->isInstalled()) {