-
Notifications
You must be signed in to change notification settings - Fork 24
68 lines (56 loc) · 1.83 KB
/
release-nightly.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
name: Release Nightly
on:
schedule:
- cron: "00 22 * * *"
jobs:
check:
if: ${{ github.ref == 'refs/heads/main'}}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for new commits
id: check
run: |
DATE=$(date -u -d "1 day ago" "+%Y-%m-%d")
if git log --since="$DATE" --oneline | grep .; then
echo "new_commits=true" >> "$GITHUB_OUTPUT"
else
echo "new_commits=false" >> "$GITHUB_OUTPUT"
fi
outputs:
new_commits: ${{ steps.check.outputs.new_commits }}
build:
needs: check
if: ${{ needs.check.outputs.new_commits == 'true'}}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm install pnpm -g && pnpm install
- name: Build package
run: pnpm run build
- name: Get current package version
id: version
run: |
DATE=$(date "+%Y%m%d")
echo "version=$(node -p "require('./lib/package.json').version")-nightly.$DATE">> "$GITHUB_ENV"
- name: cd cli/build/config/output
run: cd cli/build/config/output
- name: Change package name
run: jq '.name="shuimo-ui-nightly"' package.json > temp.json && mv temp.json package.json
- name: change version
run: |
git config --global user.email "[email protected]"
git config --global user.name "Cai"
npm version ${{ env.version }} --force
- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}