Skip to content

Commit

Permalink
ci: setup and configure release please
Browse files Browse the repository at this point in the history
  • Loading branch information
receter committed Sep 9, 2024
1 parent 6ab0d52 commit 4966008
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 37 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/init-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Init pnpm

runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: pnpm install --frozen-lockfile
shell: bash
54 changes: 54 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
utils--release_created: ${{ steps.release.outputs['packages/utils--release_created']}}
ui--release_created: ${{ steps.release.outputs['packages/ui--release_created']}}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}

publish-utils:
if: ${{needs.release-please.outputs.utils--release_created}}
runs-on: ubuntu-latest
needs: release-please
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/workflows/init-pnpm

- name: Publish 🚀
shell: bash
run: pnpm publish packages/utils --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-ui:
if: ${{needs.release-please.outputs.ui--release_created}}
runs-on: ubuntu-latest
needs: release-please
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/workflows/init-pnpm

- name: Publish 🚀
shell: bash
run: pnpm publish packages/ui --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37 changes: 0 additions & 37 deletions .github/workflows/release-ui.yml

This file was deleted.

1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
11 changes: 11 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"monorepo-tags": true,
"packages": {
"packages/utils": {
"release-type": "node"
},
"packages/ui": {
"release-type": "node"
}
}
}

0 comments on commit 4966008

Please sign in to comment.