Skip to content

Commit

Permalink
fix: init new version
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Sep 2, 2024
1 parent fbf8681 commit 3358fa7
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,74 +24,73 @@ 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@v3
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@v4
id: pnpm-install
with:
version: 9.6.0
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
- name: Build for production
if: ${{ steps.release.outputs.release_created }}
run: pnpm build
if: ${{ steps.release.outputs.release_created }}

# Archive package
- name: Archive package
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: |
ls -l ./build
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 3358fa7

Please sign in to comment.