File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [master, main]
6+ tags :
7+ - " v*.*"
8+ pull_request :
9+ branches : [master, main]
10+
11+ jobs :
12+ build :
13+ if : github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/')
14+ runs-on : ubuntu-latest
15+ steps :
16+ - uses : actions/checkout@v4
17+
18+ - uses : actions/setup-node@v4
19+ with :
20+ node-version : " 22"
21+ cache : npm
22+
23+ - name : Install dependencies
24+ run : npm ci
25+
26+ - name : Build
27+ run : npm run build
28+
29+ release :
30+ if : >-
31+ github.event_name == 'push' &&
32+ startsWith(github.ref, 'refs/tags/v') &&
33+ contains(github.ref_name, '.')
34+ runs-on : ubuntu-latest
35+ permissions :
36+ contents : write
37+ steps :
38+ - uses : actions/checkout@v4
39+
40+ - uses : actions/setup-node@v4
41+ with :
42+ node-version : " 22"
43+ cache : npm
44+
45+ - name : Install dependencies
46+ run : npm ci
47+
48+ - name : Build
49+ run : npm run build
50+
51+ - name : Pack release zip
52+ id : pack
53+ run : |
54+ DATE=$(date -u +"%Y-%m-%d")
55+ ASSET="diary-${GITHUB_REF_NAME}_${DATE}.zip"
56+ (cd dist && zip -r "../${ASSET}" .)
57+ echo "asset=${ASSET}" >> "$GITHUB_OUTPUT"
58+ ls -la "${ASSET}"
59+
60+ - name : Upload to GitHub Release
61+ uses : softprops/action-gh-release@v2
62+ with :
63+ files : ${{ steps.pack.outputs.asset }}
64+ generate_release_notes : true
Original file line number Diff line number Diff line change 11.DS_Store
22node_modules
3- package-lock.json
43/dist
54/diary
65
You can’t perform that action at this time.
0 commit comments