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

ci: add release workflow #942

Closed
wants to merge 9 commits 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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "faker-js/faker" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create release pull request or publish new release

on:
push:
branches:
- main
paths:
- '.changeset/**'

jobs:
release:
name: Create release pull request or publish new release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7

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

- name: Install deps
run: pnpm install

# @link https://github.com/changesets/action
- name: Create release PR and changelog or publish
uses: changesets/action@v1.2.2
with:
commit: 'chore: update versions'
title: 'chore: update versions'
publish: pnpm ci:publish
env:
HOME: ${{ github.workspace }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ yarn.lock

cypress/screenshots
cypress/videos

# security: atlassian/changeset
**/.netrc
**/.npmrc
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@
"docs:test:e2e:ci": "run-s docs:build:ci docs:test:e2e:run",
"docs:test:e2e:run": "run-p --race docs:serve \"cypress run\"",
"docs:test:e2e:open": "run-p --race docs:serve \"cypress open\"",
"release": "standard-version",
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build"
"ci:publish": "pnpm run build && pnpm changeset publish"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged --concurrent false",
Expand All @@ -92,6 +91,8 @@
},
"devDependencies": {
"@algolia/client-search": "~4.13.0",
"@changesets/changelog-github": "^0.4.4",
"@changesets/cli": "^2.22.0",
"@types/markdown-it": "~12.2.3",
"@types/node": "~17.0.31",
"@types/prettier": "~2.6.0",
Expand Down Expand Up @@ -124,7 +125,6 @@
"rimraf": "~3.0.2",
"sanitize-html": "~2.7.0",
"simple-git-hooks": "~2.7.0",
"standard-version": "~9.3.2",
"typedoc": "~0.22.15",
"typedoc-plugin-missing-exports": "~0.22.6",
"typescript": "~4.6.4",
Expand Down
Loading