Skip to content

chore(master): release 1.1.1 (#29) #13

chore(master): release 1.1.1 (#29)

chore(master): release 1.1.1 (#29) #13

# 触发条件:当代码被推送到仓库时
on:
push:
# 触发的分支:仅当推送到 master 分支时触发
branches:
- master
# 涉及以下路径文件的更改不会触发工作流
paths-ignore:
- LICENSE
- README.md
# 工作流名称
name: release-please
# 定义工作流中的各个任务
jobs:
# 任务名称:release-please
release-please:
# 运行环境:Ubuntu 最新版本
runs-on: ubuntu-latest
# 定义任务中的各个步骤
steps:
# 步骤:使用 Google 的 release-please-action 动作
- name: Create Release
uses: google-github-actions/release-please-action@v3
# 为这个步骤指定一个标识符,方便后续引用
id: release-please
with:
# 指定发布类型为 Node.js 项目
release-type: node
# 指定要发布的包名
package-name: 'kkkkkk-10086'
# 指定默认分支名称
default-branch: master
# 步骤:获取版本号
- name: Get version
if: steps.release-please.outputs.release_created == 'true'
id: get_version
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
# 步骤:压缩文件
- name: Compress files
if: steps.release-please.outputs.release_created == 'true'
run: |
zip -r kkkkkk-10086-v${{ env.VERSION }}.zip apps config module resources guoba.support.js index.js README.md package.json LICENSE
# 步骤:上传 ZIP 发布资产
- name: Upload ZIP release asset
if: steps.release-please.outputs.release_created == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release-please.outputs.upload_url }}
asset_path: ./kkkkkk-10086-v${{ env.VERSION }}.zip
asset_name: kkkkkk-10086-v${{ env.VERSION }}.zip
asset_content_type: application/zip