-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (66 loc) · 2.13 KB
/
release.yml
File metadata and controls
80 lines (66 loc) · 2.13 KB
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
name: Build & Release
on:
push:
branches:
- main
paths:
- "version.txt"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Read version
id: version
run: |
VERSION=$(cat version.txt)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create OpenKernel package folder
run: |
mkdir -p package/OpenKernel
rsync -av \
--exclude='.git' \
--exclude='.github' \
--exclude='version.txt' \
--exclude='package' \
--exclude='install_pkg.sh' \
--exclude='link.ld' \
--exclude='Makefile' \
--exclude='notes.txt' \
./ package/OpenKernel/
cp install_pkg.sh package/
cp link.ld package/
cp Makefile package/
cp notes.txt package/
- name: Create ZIP package
run: |
cd package
zip -r OpenKernel_${{ steps.version.outputs.version }}.zip OpenKernel install_pkg.sh link.ld Makefile notes.txt
- name: Generate Changelog (version.txt based)
run: |
VERSION="${{ steps.version.outputs.version }}"
VERSION_COMMITS=$(git log --pretty=format:"%H" -- version.txt)
HASHES=($VERSION_COMMITS)
if [ ${#HASHES[@]} -lt 2 ]; then
COMMITS=$(git log --pretty=format:"- %s")
else
CURRENT=${HASHES[0]}
PREVIOUS=${HASHES[1]}
COMMITS=$(git log $PREVIOUS..$CURRENT --pretty=format:"- %s")
fi
echo "## 🕒 Changes:" > CHANGELOG.md
echo "" >> CHANGELOG.md
echo "$COMMITS" >> CHANGELOG.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: openkernel${{ steps.version.outputs.version }}
name: OpenKernel ${{ steps.version.outputs.version }}
body_path: CHANGELOG.md
files: |
package/OpenKernel_${{ steps.version.outputs.version }}.zip