chore: add github actions workflows #1
Workflow file for this run
This file contains hidden or 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
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version tag to release, e.g. v0.1.0" | |
| required: true | |
| default: "v0.1.0" | |
| source_ref: | |
| description: "Git ref to build from, e.g. main or v0.1.0" | |
| required: false | |
| default: "" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build_release_preview: | |
| name: Build Release Preview | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.inputs.source_ref || github.ref }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| cache-dependency-path: "package-lock.json" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build preview output | |
| run: npm run build | |
| - name: Package preview build | |
| shell: bash | |
| run: | | |
| TAG="${{ github.event.inputs.version || github.ref_name }}" | |
| mkdir -p release | |
| tar -czf "release/lime-novel-${TAG}-preview-build.tar.gz" out package.json package-lock.json | |
| - name: Publish GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.inputs.version || github.ref_name }} | |
| name: Lime Novel ${{ github.event.inputs.version || github.ref_name }} | |
| prerelease: ${{ contains(github.event.inputs.version || github.ref_name, '-') }} | |
| generate_release_notes: true | |
| body: | | |
| 这是当前 `lime-novel` 的预览构建产物。 | |
| 当前仓库尚未接入桌面安装包打包与签名链路,因此本次 release 先附带 `preview build`,用于内部验证与版本归档。 | |
| files: | | |
| release/*.tar.gz |