https://github.com/tada5hi/monorepo-publish-action
A GitHub action to publish packages of a monorepo.
https://github.com/tada5hi/monorepo-publish-action
Last synced: 7 months ago
JSON representation
A GitHub action to publish packages of a monorepo.
- Host: GitHub
- URL: https://github.com/tada5hi/monorepo-publish-action
- Owner: tada5hi
- Created: 2024-01-06T09:51:59.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-24T22:14:52.000Z (over 1 year ago)
- Last Synced: 2025-01-14T10:19:18.735Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.31 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# monorepo-publish-action ✨
A GitHub action to publish packages of a monorepo.
The action is based on the library [workspaces-publish](https://github.com/tada5hi/workspaces-publish).## Action inputs
| Name | Description | Default |
|------------|-------------------------------|-------------------------------|
| `token` | Token for the registry | |
| `registry` | Registry address | `https://registry.npmjs.org/` |
| `cwd` | Directory of the root package | `.` |## Usage
It is important that before this action step is executed, additional steps are performed,
such as node installation, checkout of the repo, building the packages,
as well as incrementing the version of the packages```yaml
uses: tada5hi/monorepo-publish-action@v1
with:
token: ${{ secrets.NPM_TOKEN }}
```### release-please
The action can also be used in combination with [release-please](https://github.com/googleapis/release-please),
as release-please only increases the versions in the monorepo, but does not release the packages.```yaml
on:
push:
branches:
- mainpermissions:
contents: write
pull-requests: writejobs:
release:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}- name: Checkout
if: steps.release.outputs.releases_created == 'true'
uses: actions/checkout@v4- name: Install Node.JS
if: steps.release.outputs.releases_created == 'true'
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
if: steps.release.outputs.releases_created == 'true'
run: npm ci- name: Publish
if: steps.release.outputs.releases_created == 'true'
uses: tada5hi/monorepo-publish-action@v1
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
```