chore: update docs #15
This file contains 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
on: | |
push: | |
branches: | |
- main | |
name: release-please | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
# 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 | |
# `GH_TOKEN` (this secret name is not important). | |
token: ${{ secrets.GH_TOKEN }} | |
# optional. customize path to release-please-config.json | |
config-file: release-please-config.json | |
# optional. customize path to .release-please-manifest.json | |
manifest-file: .release-please-manifest.json | |
# Checkout | |
- name: Checkout | |
uses: actions/checkout@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
# Install Node.js | |
- name: Install Node.js | |
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 | |
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 | |
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 | |
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 | |
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 | |
run: | | |
pnpm prepareRelease | |
if: ${{ steps.release.outputs.release_created }} | |
# Build for production | |
- name: Build for production | |
run: pnpm build | |
if: ${{ steps.release.outputs.release_created }} | |
# Archive package | |
- name: Archive package | |
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 | |
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 | |
if: ${{ steps.release.outputs.releases_created }} |