|
1 | 1 | name: Release |
2 | | - |
3 | 2 | on: |
4 | 3 | push: |
5 | 4 | tags: |
6 | 5 | - "v*" |
7 | | - |
8 | 6 | jobs: |
9 | 7 | release: |
10 | 8 | name: Release |
11 | | - runs-on: ubuntu-24.04 |
| 9 | + runs-on: ubuntu-latest |
12 | 10 | permissions: |
13 | | - contents: write # write is required to create releases and push. |
| 11 | + contents: write |
14 | 12 | steps: |
15 | | - - name: Code checkout |
16 | | - uses: actions/checkout@v4 |
17 | | - |
18 | | - - name: Setup Node |
19 | | - uses: actions/setup-node@v4 |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + - uses: actions/setup-node@v4 |
20 | 15 | with: |
21 | 16 | node-version: 22 |
22 | 17 | cache: yarn |
23 | | - |
24 | | - - name: Install dependencies |
25 | | - run: yarn install --frozen-lockfile |
26 | | - |
| 18 | + - run: yarn install --frozen-lockfile |
27 | 19 | - run: yarn tsc |
28 | | - - run: yarn lint |
29 | | - - name: Build |
30 | | - run: yarn build:production |
31 | | - |
32 | | - - name: Create release branch and bump version |
33 | | - env: |
34 | | - REF: ${{ github.ref }} |
| 20 | + - run: yarn build:production |
| 21 | + - name: create release branch and bump version |
35 | 22 | run: | |
36 | | - BRANCH=release/"${REF:10}" |
| 23 | + BRANCH=release/${{ github.ref_name }} |
37 | 24 | git config --local user.email 'ci@pterodactyl.io' |
38 | 25 | git config --local user.name 'Pterodactyl CI' |
39 | 26 | git checkout -b "$BRANCH" |
40 | 27 | git push -u origin "$BRANCH" |
41 | | - sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php |
| 28 | + sed -i "s/'canary'/'${{ github.ref_name }}'/" config/app.php |
42 | 29 | git add config/app.php |
43 | 30 | git commit -m 'ci(release): bump version' |
44 | 31 | git push |
45 | | -
|
46 | | - - name: Create release archive |
| 32 | + - name: create release archive |
47 | 33 | run: | |
48 | | - rm -rf node_modules tests CODE_OF_CONDUCT.md CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix |
| 34 | + rm -rf node_modules tests CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix |
49 | 35 | tar -czf panel.tar.gz * .editorconfig .env.example .eslintignore .eslintrc.js .gitignore .prettierrc.json |
50 | | -
|
51 | | - - name: Extract changelog |
52 | | - env: |
53 | | - REF: ${{ github.ref }} |
54 | | - run: | |
55 | | - sed -n "/^## ${REF:10}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG |
56 | | -
|
57 | | - - name: Create checksum and add to changelog |
| 36 | + - name: write changelog |
58 | 37 | run: | |
59 | | - SUM=`sha256sum panel.tar.gz` |
60 | | - echo -e "\n#### SHA256 Checksum\n\n\`\`\`\n$SUM\n\`\`\`\n" >> ./RELEASE_CHANGELOG |
61 | | - echo "$SUM" > checksum.txt |
62 | | -
|
63 | | - - name: Create release |
64 | | - id: create_release |
65 | | - uses: softprops/action-gh-release@v2 |
| 38 | + sed -n "/^## ${{ github.ref_name }}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG |
| 39 | + - uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b |
66 | 40 | env: |
67 | 41 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
68 | 42 | with: |
69 | 43 | draft: true |
70 | | - prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} |
| 44 | + prerelease: ${{ contains(github.ref_name, 'rc') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }} |
71 | 45 | body_path: ./RELEASE_CHANGELOG |
72 | 46 | files: | |
73 | 47 | panel.tar.gz |
74 | | - checksum.txt |
0 commit comments