Skip to content

Commit

Permalink
Release: [email protected] 适配Lit Element
Browse files Browse the repository at this point in the history
  • Loading branch information
xsf0105 committed Dec 19, 2023
1 parent 2c3faa4 commit 01e7b7b
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 1 deletion.
89 changes: 89 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Release

on:
push:
branches: [main]
paths:
- 'package.json'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: https://registry.npmjs.org/

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
run_install: false

# Use cache to reduce installation time
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm run build

- name: publish
working-directory: './'
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm publish

# 使用 tyankatsu0105/read-package-version-actions@v1 工具来读取对应的package.json 数据
- name: Read package.json
uses: tyankatsu0105/read-package-version-actions@v1
with:
path: './'
id: package-version

# # 生成 Changelog
# - name: Changelog
# run: pnpm run changlog

# 提交 Tag
- name: create git tag
env:
GITHUB_TOKEN: ${{ secrets.GIT_ACTION }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "Sanqi"
git tag v${{ steps.package-version.outputs.version }}
git push origin v${{ steps.package-version.outputs.version }}
# 下面主要是创建 github 的release
# 关于创建 release 的更多参数,可以查看 actions/create-release@v1
- name: Create Release for Tag
id: release_tag
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GIT_ACTION }} # 这块需要用到 github的token,因为需要对分之进行代码推送
with:
tag_name: v${{ steps.package-version.outputs.version }}
release_name: Release v${{ steps.package-version.outputs.version }}
prerelease: false # 是否为预发布版本
body: |
请点击查看 [更新日志](https://github.com/hellof2e/gluang/blob/main/CHANGELOG.md).
19 changes: 19 additions & 0 deletions .github/workflows/sync-gitee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Sync to Gitee

on: [ push, delete, create ]

jobs:
deploy-site-sync-gitee:
runs-on: ubuntu-latest
steps:
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
# 注意在 Settings -> Secrets 配置 GITEE_RSA_PRIVATE_KEY
# 也可以在组织 Settings -> Secrets 配置全局性的 GITEE_RSA_PRIVATE_KEY
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
# 注意替换为你的 GitHub 源仓库地址
source-repo: [email protected]:hellof2e/quark.git
# 注意替换为你的 Gitee 目标仓库地址
destination-repo: [email protected]:hellof2e/quark.git
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gluang",
"version": "0.0.4",
"version": "0.0.5",
"description": "Simple shared app state management for Quarkc",
"type": "module",
"main": "./lib/index.umd.js",
Expand Down

0 comments on commit 01e7b7b

Please sign in to comment.