Skip to content

Release Package

Release Package #1

Workflow file for this run

name: Release Package
on:
workflow_dispatch:
inputs:
project:
description: "The package folder name under packages/ to release (e.g. my-package)"
required: true
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # Allows pushing changes and creating releases
issues: write
pull-requests: write
steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v3
# Setup Node.js (v20+)
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
# Setup pnpm (using pnpm/action-setup@v4)
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: "8" # or whichever version of pnpm you prefer
# Cache pnpm store for faster installs
- name: Cache pnpm store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
# Use sparse-checkout if releasing from bnb-chain example-hub (to avoid cloning the entire repo)
# Here we assume that if the project input is not a URL, it is a bnb-chain example name.
- name: Install dependencies and build package
working-directory: packages/${{ github.event.inputs.project }}
run: |
pnpm install
pnpm run build || echo "No build script found"
# Publish to NPM and create GitHub release using semantic-release.
# Note: To limit release notes to commits with the create-bnb theme, configure semantic-release (e.g. releaseRules)
- name: Run semantic-release
working-directory: packages/${{ github.event.inputs.project }}
uses: cycjimmy/semantic-release-action@v3

Check failure on line 56 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Release Package

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 56, Col: 9): Unexpected value 'uses' .github/workflows/release.yml (Line: 60, Col: 9): Unexpected value 'with'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
config_file: ".releaserc.js"
package: ${{ github.event.inputs.project }}