Skip to content

Commit

Permalink
Replace semantic-release with changesets (#3)
Browse files Browse the repository at this point in the history
* Remove semantic release

* Add changesets
  • Loading branch information
ilijaNL committed Mar 20, 2023
1 parent c1fe721 commit 9313717
Show file tree
Hide file tree
Showing 7 changed files with 1,301 additions and 2,561 deletions.
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/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/lovely-gorillas-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ilijanl/graphql-ws-graphqless': minor
---

Simplify subscription payload
82 changes: 19 additions & 63 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,39 @@
name: Build and release

on: workflow_dispatch
on:
push:
branches:
- master

permissions:
contents: write
pull-requests: write
issues: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install
run: yarn install --immutable
- name: Build
run: yarn build
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: build
path: |
lib
umd
changelog:
name: Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # necessary for correct changelog
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install
run: yarn install --immutable
- name: Changelog
run: |
yarn semantic-release \
-p @semantic-release/release-notes-generator \
--dry-run \
| tee changelog.out
sed -n '/#/,$p' changelog.out >> $GITHUB_STEP_SUMMARY
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
needs: [build, changelog]
environment: npm
permissions:
id-token: write
contents: write
packages: write
pull-requests: write
issues: read
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # necessary for correct CHANGELOGS
fetch-depth: 0
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install
run: yarn install --immutable
- name: Download build
uses: actions/download-artifact@v3
- name: Create PR or Release
uses: changesets/action@v1
with:
name: build
- name: Release
publish: yarn ci:publish
createGithubReleases: true # only works after publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release
28 changes: 0 additions & 28 deletions .releaserc

This file was deleted.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"build:cjs": "tsc -b tsconfig.cjs.json",
"build:umd": "rollup --bundleConfigAsCjs --config rollup.config.ts --configPlugin typescript && gzip umd/graphql-ws.min.js -c > umd/graphql-ws.min.js.gz",
"build": "yarn build:esm && yarn build:cjs && yarn build:umd",
"release": "semantic-release"
"ci:publish": "yarn build && changeset publish"
},
"devDependencies": {
"@babel/core": "^7.21.0",
Expand All @@ -96,11 +96,10 @@
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.21.0",
"@changesets/cli": "^2.26.0",
"@fastify/websocket": "^7.1.2",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.0.0",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/git": "^10.0.1",
"@types/eslint": "^8.21.1",
"@types/glob": "^8.1.0",
"@types/jest": "^29.4.0",
Expand All @@ -119,7 +118,6 @@
"prettier": "^2.8.4",
"replacestream": "^4.0.3",
"rollup": "^3.18.0",
"semantic-release": "^20.1.1",
"subscriptions-transport-ws": "^0.11.0",
"tslib": "^2.5.0",
"typedoc": "^0.23.26",
Expand Down
Loading

0 comments on commit 9313717

Please sign in to comment.