github action 配置

实现node项目 自动构建并打包上传release

name: 构建插件内容

on:
  push: 
    branches:
      - main

jobs:
  build-project:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - uses: pnpm/action-setup@v2
        with:
          version: 7.17.1
      
      - name: 设置 Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '16'
          cache: 'pnpm'
      
      - name: '安装依赖'
        run: pnpm install --frozen-lockfile

      - name: '构建'
        run: pnpm run build
      
      - name: Zip the Build
        run: zip -r ${{ steps.get_version.outputs.VERSION }}} ./dist/
      
      
      - name: Release
        uses: softprops/action-gh-release@v1
        with:
          tag_name: ${{ github.ref }}
          name: Release ${{ github.ref }}
          files: |
            ${{ steps.get_version.outputs.VERSION }}}.zip


你可能感兴趣的:(入门学习,github,git)