Manual Release #3
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
name: Manual Release | |
on: | |
workflow_dispatch: | |
inputs: | |
name: | |
type: choice | |
description: Package name (npm) | |
options: | |
- "@abstract-money/core" | |
- "@abstract-money/cli" | |
- "@abstract-money/react" | |
# TODO: Infer from package name | |
path: | |
type: choice | |
description: Directory name (packages/*) | |
options: | |
- "core" | |
- "cli" | |
- "react" | |
env: | |
FORCE_COLOR: true | |
jobs: | |
release-manual: | |
name: Publish manually | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
submodules: true | |
- name: Install dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Determine version | |
uses: ./.github/actions/version-pr | |
id: determine-version | |
env: | |
PACKAGE_PATH: ${{ github.event.inputs.path }} | |
- name: Publish to npm | |
run: | | |
pnpm build | |
cd packages/$PACKAGE_PATH | |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc | |
pnpm publish --no-git-checks --access public --tag experimental | |
echo "🎉 Experimental release published 📦️ on npm: https://npmjs.com/package/${{ github.event.inputs.name }}/v/${{ env.VERSION }}" | |
echo "Install via: pnpm add ${{ github.event.inputs.name }}@${{ env.VERSION }}" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
PACKAGE_PATH: ${{ github.event.inputs.path }} | |
VERSION: ${{ steps.determine-version.outputs.version }} |