Skip to content

Commit 481e8b6

Browse files
committed
ci: init Sync to Release
1 parent 1b70ca8 commit 481e8b6

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Sync to Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 60
12+
concurrency:
13+
group: release-branch
14+
cancel-in-progress: false
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: 'pnpm'
30+
31+
- name: Install dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Build
35+
run: pnpm run build
36+
37+
- name: Setup tree command
38+
run: sudo apt-get update && sudo apt-get install -y tree
39+
40+
- name: Export to dist
41+
run: |
42+
mkdir -p dist
43+
npx build-marketplace export ./dist
44+
tree ./dist
45+
46+
- name: Push to release branch
47+
run: |
48+
git fetch origin release || git checkout --orphan release
49+
git checkout release || git checkout --orphan release
50+
51+
find . -maxdepth 1 \
52+
-not -name '.git' \
53+
-not -name '.' \
54+
-not -name 'dist' \
55+
-exec rm -rf {} +
56+
57+
cp -R dist/. . && rm -rf dist
58+
59+
cat <<EOF > README.md
60+
# Lynx Skills
61+
62+
This repository contains the built plugins & skills of Lynx.
63+
64+
If you want to see the source code, please visit the \`https://github.com/${{ github.repository }}/tree/main\` branch.
65+
EOF
66+
67+
git config --local user.name "github-actions[bot]"
68+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
69+
git add -A
70+
71+
if git diff --cached --quiet; then
72+
echo "No changes to commit, skipping"
73+
else
74+
git commit \
75+
--author="$(git log -1 --format='%an <%ae>' ${{ github.sha }})" \
76+
-m "$(git log -1 --format='%B' ${{ github.sha }})"
77+
git show HEAD
78+
git push origin release
79+
fi

0 commit comments

Comments
 (0)