Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Setup automatic release #36

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 🚀 Release

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
# This allows the changesets/action step to override the default actions user,
# and allow CI jobs on commits coming from that step.
persist-credentials: false

- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: 8.4.0

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20.9.0
cache: 'pnpm'

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

- name: Set git user
run: |
git config user.name FILL_ME_IN
git config user.email FILL_ME_IN

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
version: pnpm run version
commit: "🎉 Release new version"
title: "🎉 Release new version"
setupGitUser: false
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"lint": "pnpm run -r lint",
"test": "pnpm run -r test",
"clean": "pnpm run -r clean",
"checks": "pnpm build && pnpm lint && pnpm test"
"checks": "pnpm build && pnpm lint && pnpm test",
"version": "pnpm changeset version && pnpm install",
"release": "pnpm build && pnpm changeset publish"
},
"keywords": [],
"devDependencies": {
Expand Down
Loading