Skip to content

Commit

Permalink
ci: migrate semantic-release to changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Aug 24, 2022
1 parent 3eef076 commit 5ff5a21
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 18 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
@@ -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)
16 changes: 16 additions & 0 deletions .changeset/config.json
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/config/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "prettier/prettier-eslint-cli"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
27 changes: 18 additions & 9 deletions .github/workflows/release.yml
Expand Up @@ -7,23 +7,32 @@ on:

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout Repo
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

- uses: actions/setup-node@v3
- name: Setup Node.js LTS
uses: actions/setup-node@v3
with:
node-version: 16

- run: npm i
node-version: lts/*

- run: npm start build
- name: Install Dependencies
run: npm i

- name: Release
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: npm run release
# this expects you to have a npm script called version that runs some logic and then calls `changeset version`.
version: npm run version
commit: 'chore: release prettier-eslint-cli'
title: 'chore: release prettier-eslint-cli'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
16.16.0
16.17.0
10 changes: 8 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "prettier-eslint-cli",
"version": "0.0.0-development",
"version": "7.0.1",
"description": "CLI for prettier-eslint",
"main": "dist/no-main.js",
"engines": {
Expand All @@ -13,6 +13,10 @@
"build": "nps build",
"lint": "nps lint",
"prepare": "patch-package && simple-git-hooks",
"prerelease": "nps build",
"release": "clean-pkg-json && changeset release",
"version": "changeset version",
"postversion": "jest -u",
"start": "nps",
"test": "nps test"
},
Expand Down Expand Up @@ -59,7 +63,10 @@
"@babel/core": "^7.18.10",
"@babel/node": "^7.18.10",
"@babel/preset-env": "^7.18.10",
"@changesets/changelog-github": "^0.4.6",
"@changesets/cli": "^2.24.3",
"all-contributors-cli": "^6.20.0",
"clean-pkg-json": "^1.0.1",
"eslint-config-kentcdodds": "^20.3.1",
"eslint-plugin-node-dependencies": "^0.8.0",
"jest": "^28.1.3",
Expand All @@ -70,7 +77,6 @@
"patch-package": "^6.4.7",
"pify": "^5.0.0",
"rimraf": "^3.0.2",
"semantic-release": "^17.4.7",
"simple-git-hooks": "^2.8.0",
"spawn-command": "0.0.2-1",
"strip-indent": "^3.0.0",
Expand Down
8 changes: 2 additions & 6 deletions test/tests/__snapshots__/cli.spec.js.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`prettier-eslint --version: stdout: --version 1`] = `
"0.0.0-development
"7.0.1
"
`;

Expand All @@ -17,10 +17,6 @@ Object {
`;

exports[`prettier-eslint test/fixtures/example*.js --write --no-eslint-ignore --no-prettier-ignore: stdout: prettier-eslint test/fixtures/example*.js --write --no-eslint-ignore --no-prettier-ignore 1`] = `
"can't resolve reference #/definitions/directiveConfigSchema from id #
can't resolve reference #/definitions/directiveConfigSchema from id #
can't resolve reference #/definitions/directiveConfigSchema from id #
can't resolve reference #/definitions/directiveConfigSchema from id #
success formatting 2 files with prettier-eslint
"success formatting 2 files with prettier-eslint
"
`;

0 comments on commit 5ff5a21

Please sign in to comment.