chore: update release.yml

This commit is contained in:
frostime 2023-06-03 14:40:39 +08:00
parent 439c2134b6
commit 78d576a19e

View file

@ -1,62 +1,62 @@
name: Create Release on Tag Push name: Create Release on Tag Push
on: on:
push: push:
tags: tags:
- "v*" - "v*"
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Checkout # Checkout
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
# Install Node.js # Install Node.js
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 18
registry-url: "https://registry.npmjs.org" registry-url: "https://registry.npmjs.org"
# Install pnpm # Install pnpm
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v2 uses: pnpm/action-setup@v2
id: pnpm-install id: pnpm-install
with: with:
version: 8 version: 8
run_install: false run_install: false
# Get pnpm store directory # Get pnpm store directory
- name: Get pnpm store directory - name: Get pnpm store directory
id: pnpm-cache id: pnpm-cache
shell: bash shell: bash
run: | run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
# Setup pnpm cache # Setup pnpm cache
- name: Setup pnpm cache - name: Setup pnpm cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-pnpm-store- ${{ runner.os }}-pnpm-store-
# Install dependencies # Install dependencies
- name: Install dependencies - name: Install dependencies
run: pnpm install run: pnpm install
# Build for production, 这一步会生成一个 package.zip # Build for production, 这一步会生成一个 package.zip
- name: Build for production - name: Build for production
run: pnpm build run: pnpm build
- name: Release - name: Release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
allowUpdates: true allowUpdates: true
artifactErrorsFailBuild: true artifactErrorsFailBuild: true
artifacts: 'package.zip' artifacts: "package.zip"
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true prerelease: true