Skip to content

ci: github action for release #1

ci: github action for release

ci: github action for release #1

Workflow file for this run

name: Release Build
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1 # fetch all history for all tags and branches
ref: dev
- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Set up Node.js (或其他构建环境)
uses: actions/setup-node@v4
with:
node-version: 'lts/*' # 根据需要修改 Node.js 版本
cache: 'pnpm' # 使用 pnpm 加速安装依赖
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm run bz # 根据项目使用的构建命令修改
- name: Test
run: echo $GITHUB_WORKSPACE |
pwd
- name: Get version from package.json
id: get_version
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:

Check failure on line 44 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Release Build

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 44, Col: 14): Unexpected value '' .github/workflows/release.yml (Line: 46, Col: 9): Unexpected value 'path'
name: ntab-output
path: ./.output/ntab-${{ env.VERSION }}-chrome.zip # 修改为构建产物的路径
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.VERSION }} # 或者根据需要自定义 tag
release_name: Release ntab ${{ env.VERSION }}
draft: true
prerelease: true
files: ./.output/ntab-${{ env.VERSION }}-chrome.zip # 修改为构建产物的路径
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}