-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (49 loc) · 1.58 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
name: Daily Release
on:
schedule:
- cron: '0 0 * * *' # Runs at 00:00 UTC every day.
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js (LTS)
uses: actions/setup-node@v2
with:
node-version: 'lts/*' # Use the latest LTS version of Node.js
- name: Install Dependencies
run: yarn install
- name: Generate Documentation
run: yarn docs
- name: Build Project
run: yarn build
- name: Commit Built Files and Documentation
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add . # Add all files, including documentation
git commit -m "chore: build and documentation for release"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run semantic-release
run: |
maxRetry=3
delay=60
for attempt in $(seq 1 $maxRetry); do
if yarn semantic-release; then
break
elif [ $attempt -lt $maxRetry ]; then
echo "Attempt $attempt failed. Retrying in $delay seconds..."
sleep $delay
else
echo "All attempts failed."
exit 1
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}