Skip to content

Commit

Permalink
Add prerelease and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
alavarello committed Dec 30, 2024
1 parent a4556d1 commit 45c4e30
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Pre release NPM package
on:
release:
types: [prereleased]

jobs:
prereleased:
name: Pre released

permissions:
contents: write
pull-requests: write

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: 'main'

- uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version-file: '.nvmrc'

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Changeset PR
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Publish Package to npmjs
on:
release:
types: [published]
types: [released]

jobs:
release:
Expand All @@ -23,10 +23,8 @@ jobs:
- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Publish to npm
uses: changesets/action@v1
with:
publish: pnpm publish

- run: npm publish --provenance --access public
name: Publish to npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 45c4e30

Please sign in to comment.