-
-
Notifications
You must be signed in to change notification settings - Fork 59
81 lines (72 loc) · 2.23 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Update Embedded Version String
env:
REF: ${{ github.ref }}
run: |
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php
- name: Build Assets
run: |
npm install
npm run build
- name: Create Release Archive
run: |
files_to_include=(
"*"
".editorconfig"
".env.example"
".gitattributes"
".gitignore"
".prettierignore"
".prettierrc.json"
)
files_to_exclude=(
"node_modules/"
"tests/"
"CODE_OF_CONDUCT.md"
"CONTRIBUTOR_LICENSE_AGREEMENT"
"crowdin.yml"
"docker-compose.ci.yml"
"phpstan.neon"
"phpunit.xml"
"stats.html"
)
# Build the exclude parameters for tar
exclude_params=()
for file in "${files_to_exclude[@]}"; do
exclude_params+=(--exclude="$file")
done
tar "${exclude_params[@]}" -czf panel.tar.gz "${files_to_include[@]}"
- name: Extract Changelog
id: extract_changelog
env:
REF: ${{ github.ref }}
run: |
sed -n "/^## ${REF:10}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG
echo "version_name=${REF:10}" >> $GITHUB_OUTPUT
- 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
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.extract_changelog.outputs.version_name }}
body_path: ./RELEASE_CHANGELOG
draft: true
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') || contains(github.ref, 'rc') }}
files: |
panel.tar.gz
checksum.txt