-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add create-release action using changesets
- Loading branch information
Showing
2 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Create release or publish to pnpm reusable workflow | ||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
description: The operating system to run the workflow on | ||
required: false | ||
type: string | ||
default: ubuntu-latest | ||
node: | ||
description: The node version to use when creating the release | ||
required: false | ||
type: string | ||
default: 18 | ||
repository: | ||
description: The repository to use when creating the release | ||
required: true | ||
type: string | ||
secrets: | ||
github_token: | ||
required: true | ||
npm_token: | ||
required: true | ||
|
||
jobs: | ||
release: | ||
if: ${{ github.repository == inputs.repository && contains('refs/heads/master', github.ref)}} | ||
runs-on: ${{ inputs.os }} | ||
|
||
steps: | ||
- name: 📦 Check out the codebase | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: ⚙️ Setup node ${{ inputs.node }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node }} | ||
registry-url: 'https://registry.npmjs.org/' | ||
|
||
- name: 📥 Monorepo install | ||
uses: wayofdev/gh-actions/actions/pnpm-install@master | ||
with: | ||
enable-corepack: false | ||
cache-node-modules: true | ||
|
||
- name: 🦋 Create release pull request or publish to npm | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
commit: 'chore: update versions' | ||
title: 'chore: update versions' | ||
cwd: ${{ github.workspace }} | ||
publish: pnpm run cs:publish | ||
version: pnpm run cs:version | ||
setupGitUser: true | ||
env: | ||
HOME: ${{ github.workspace }} | ||
GITHUB_TOKEN: ${{ secrets.github_token }} | ||
NPM_TOKEN: ${{ secrets.npm_token }} |
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