55 push :
66 branches :
77 - main
8- pull_request :
9- branches :
10- - main
118
129jobs :
1310 build-and-release :
14- # Skip if commit message contains [skip ci] or [ci skip]
1511 if : " !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
1612
1713 strategy :
@@ -31,113 +27,60 @@ jobs:
3127 runs-on : ${{ matrix.os }}
3228
3329 steps :
34- - name : Checkout code
35- uses : actions/checkout@v4
30+ - uses : actions/checkout@v4
3631
37- - name : Set up CMake
38- 32+ - uses : jwlawson/actions-setup-cmake@v2
3933 with :
4034 cmake-version : ' 3.25.x'
4135
42- - name : Configure CMake
43- run : cmake -B build -DCMAKE_BUILD_TYPE=Release
44-
4536 - name : Build
46- run : cmake --build build --config Release
37+ run : |
38+ cmake -B build -DCMAKE_BUILD_TYPE=Release
39+ cmake --build build --config Release
4740
48- - name : Prepare artifact (Linux/Mac)
41+ - name : Prepare (Linux/Mac)
4942 if : matrix.os != 'windows-latest'
5043 run : |
5144 mkdir -p artifacts
5245 cp build/${{ matrix.artifact_name }} artifacts/${{ matrix.asset_name }}
5346 chmod +x artifacts/${{ matrix.asset_name }}
5447
55- - name : Prepare artifact (Windows)
48+ - name : Prepare (Windows)
5649 if : matrix.os == 'windows-latest'
5750 run : |
5851 mkdir artifacts
5952 copy build\Release\${{ matrix.artifact_name }} artifacts\${{ matrix.asset_name }}
6053
61- - name : Upload artifacts
62- uses : actions/upload-artifact@v4
54+ - uses : actions/upload-artifact@v4
6355 with :
6456 name : ${{ matrix.asset_name }}
6557 path : artifacts/${{ matrix.asset_name }}
6658
67- create- release :
59+ release :
6860 needs : build-and-release
6961 runs-on : ubuntu-latest
70- if : " !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
71-
7262 permissions :
7363 contents : write
7464
7565 steps :
76- - name : Checkout code
77- uses : actions/checkout@v4
66+ - uses : actions/checkout@v4
7867
79- - name : Download all artifacts
80- uses : actions/download-artifact@v4
68+ - uses : actions/download-artifact@v4
8169 with :
8270 path : artifacts
8371
84- - name : Display structure of downloaded files
85- run : ls -R artifacts
86-
87- - name : Get current date
88- id : date
89- run : echo "date=$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT
90-
91- - name : Get short SHA
92- id : sha
93- run : echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
72+ - name : Get version
73+ id : version
74+ run : |
75+ echo "date=$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT
76+ echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
9477
95- - name : Create Release
96- id : create_release
97- uses : softprops/action-gh-release@v1
78+ - uses : softprops/action-gh-release@v2
9879 env :
9980 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
10081 with :
101- tag_name : build-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}
102- release_name : Auto Build ${{ steps.date.outputs.date }}
103- body : |
104- ## π Automated Build Release
105-
106- **Build Date:** ${{ steps.date.outputs.date }}
107- **Commit:** ${{ steps.sha.outputs.sha }}
108- **Branch:** ${{ github.ref_name }}
109-
110- ### π¦ Downloads
111- Download the appropriate binary for your platform below.
112-
113- ### β¨ Features
114- - β
Add, view, delete, and manage tasks
115- - β
Task priorities (High, Medium, Low)
116- - β
Categories and due dates
117- - β
Search functionality
118- - β
Persistent storage
119- - β
Colorful CLI interface
120- - β
Full-width terminal headers
121-
122- ### π§ Installation
123-
124- **Linux/macOS:**
125- ` ` ` bash
126- chmod +x todo-app-*
127- ./todo-app-*
128- ` ` `
129-
130- **Windows:**
131- ` ` ` cmd
132- todo-app-windows-amd64.exe
133- ` ` `
134-
135- ---
136- π‘ **Tip:** Add `[skip ci]` to your commit message to skip automatic builds.
137-
138- π **Commit:** ${{ github.event.head_commit.message }}
139- draft : false
140- prerelease : false
82+ tag_name : build-${{ steps.version.outputs.date }}-${{ steps.version.outputs.sha }}
83+ name : Build ${{ steps.version.outputs.date }}
14184 files : |
14285 artifacts/todo-app-linux-amd64/todo-app-linux-amd64
14386 artifacts/todo-app-macos-amd64/todo-app-macos-amd64
0 commit comments