Skip to content

Commit

Permalink
fix: 修复未能自动生成打包文件的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Mar 4, 2024
1 parent 01e41ac commit 931bbe9
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/release-please.yml
Expand Up @@ -11,6 +11,7 @@ jobs:
# Create release
- name: Create release
uses: google-github-actions/release-please-action@v4
id: release
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
Expand All @@ -23,68 +24,68 @@ jobs:

# Checkout
- name: Checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}

# Install Node.js
- name: Install Node.js
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}

# Install pnpm
- name: Install pnpm
if: ${{ steps.release.outputs.release_created }}
uses: pnpm/action-setup@v3
id: pnpm-install
with:
version: 8
run_install: false
if: ${{ steps.release.outputs.release_created }}

# Get pnpm store directory
- name: Get pnpm store directory
if: ${{ steps.release.outputs.release_created }}
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
if: ${{ steps.release.outputs.release_created }}

# Setup pnpm cache
- name: Setup pnpm cache
if: ${{ steps.release.outputs.release_created }}
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
if: ${{ steps.release.outputs.release_created }}

# Install dependencies
- name: Install dependencies
if: ${{ steps.release.outputs.release_created }}
run: pnpm install
if: ${{ steps.release.outputs.release_created }}

# Prepare new version
# https://github.com/google-github-actions/release-please-action#outputs
- name: Prepare new version
if: ${{ steps.release.outputs.release_created }}
run: |
pnpm prepareRelease
if: ${{ steps.release.outputs.release_created }}

# Build for production and Archive package
- name: Build for production
if: ${{ steps.release.outputs.release_created }}
run: pnpm package
if: ${{ steps.release.outputs.release_created }}

# Upload package to release
# https://github.com/philips-labs/terraform-aws-github-runner/blob/main/.github/workflows/release.yml#L46
- name: Upload package.zip to the release
if: ${{ steps.release.outputs.releases_created }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
for f in $(find ./build -name '*.zip'); do
gh release upload ${{ steps.release.outputs.tag_name }} $f
done
done
if: ${{ steps.release.outputs.releases_created }}

0 comments on commit 931bbe9

Please sign in to comment.