Skip to content

Commit 01e7b7b

Browse files
committed
Release: gluang@0.0.5 适配Lit Element
1 parent 2c3faa4 commit 01e7b7b

3 files changed

Lines changed: 109 additions & 1 deletion

File tree

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'package.json'
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup node
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: '16'
21+
registry-url: https://registry.npmjs.org/
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v2
25+
with:
26+
version: 7
27+
run_install: false
28+
29+
# Use cache to reduce installation time
30+
- name: Get pnpm store directory
31+
id: pnpm-cache
32+
shell: bash
33+
run: |
34+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
35+
36+
- uses: actions/cache@v3
37+
name: Setup pnpm cache
38+
with:
39+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Install dependencies
45+
run: pnpm install
46+
47+
- name: Build
48+
run: pnpm run build
49+
50+
- name: publish
51+
working-directory: './'
52+
env:
53+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
54+
run: npm publish
55+
56+
# 使用 tyankatsu0105/read-package-version-actions@v1 工具来读取对应的package.json 数据
57+
- name: Read package.json
58+
uses: tyankatsu0105/read-package-version-actions@v1
59+
with:
60+
path: './'
61+
id: package-version
62+
63+
# # 生成 Changelog
64+
# - name: Changelog
65+
# run: pnpm run changlog
66+
67+
# 提交 Tag
68+
- name: create git tag
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GIT_ACTION }}
71+
run: |
72+
git config --local user.email "sanqi_med@163.com"
73+
git config --local user.name "Sanqi"
74+
git tag v${{ steps.package-version.outputs.version }}
75+
git push origin v${{ steps.package-version.outputs.version }}
76+
77+
# 下面主要是创建 github 的release
78+
# 关于创建 release 的更多参数,可以查看 actions/create-release@v1
79+
- name: Create Release for Tag
80+
id: release_tag
81+
uses: actions/create-release@v1
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GIT_ACTION }} # 这块需要用到 github的token,因为需要对分之进行代码推送
84+
with:
85+
tag_name: v${{ steps.package-version.outputs.version }}
86+
release_name: Release v${{ steps.package-version.outputs.version }}
87+
prerelease: false # 是否为预发布版本
88+
body: |
89+
请点击查看 [更新日志](https://github.com/hellof2e/gluang/blob/main/CHANGELOG.md).

.github/workflows/sync-gitee.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Sync to Gitee
2+
3+
on: [ push, delete, create ]
4+
5+
jobs:
6+
deploy-site-sync-gitee:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Sync to Gitee
10+
uses: wearerequired/git-mirror-action@master
11+
env:
12+
# 注意在 Settings -> Secrets 配置 GITEE_RSA_PRIVATE_KEY
13+
# 也可以在组织 Settings -> Secrets 配置全局性的 GITEE_RSA_PRIVATE_KEY
14+
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
15+
with:
16+
# 注意替换为你的 GitHub 源仓库地址
17+
source-repo: git@github.com:hellof2e/quark.git
18+
# 注意替换为你的 Gitee 目标仓库地址
19+
destination-repo: git@gitee.com:hellof2e/quark.git

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gluang",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Simple shared app state management for Quarkc",
55
"type": "module",
66
"main": "./lib/index.umd.js",

0 commit comments

Comments
 (0)