-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release: [email protected] 适配Lit Element
- Loading branch information
Showing
3 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters