Skip to content

Commit

Permalink
feat: add changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
charlielizzy committed Jan 23, 2024
1 parent 1bb5c74 commit e82a36d
Show file tree
Hide file tree
Showing 7 changed files with 630 additions and 23 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/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/slimy-feet-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@zopauk/react-components': minor
---

Setup changesets
22 changes: 11 additions & 11 deletions .github/workflows/ci.yaml → .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI
name: Checks
on: push

jobs:
check:
name: Test and release
name: Checks and tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -48,13 +48,13 @@ jobs:
reporter: github-pr-review
eslint_flags: 'src/**/*.{ts,tsx}'

- name: Compile the code
run: pnpm compile
# - name: Compile the code
# run: pnpm compile

- name: Release
run: pnpm release
env:
HUSKY_SKIP_HOOKS: 1
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: Release
# run: pnpm release
# env:
# HUSKY_SKIP_HOOKS: 1
# GH_TOKEN: ${{ secrets.GH_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
56 changes: 51 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,64 @@
name: Announce the release on Slack
name: Release react-components library

on:
release:
types: [created]
push:
branches:
- master

jobs:
slack:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Compile the code
run: pnpm compile

- name: Create Release Pull Request or Publish to npm
id: changesets
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: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Slackify the release body
id: release_body
uses: LoveToKnow/slackify-markdown-action@v1.0.0
uses: LoveToKnow/slackify-markdown-action@v1.0.2
with:
text: ${{ github.event.release.body }}

- uses: homeday-de/slack-release-bot-action@main
with:
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"lint": "eslint 'src/**/*.{ts,tsx}'",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc --noEmit",
"release": "semantic-release -e ./etc/semantic-release/config.js --no-ci",
"release": "changeset publish",
"prepare": "husky install"
},
"dependencies": {
Expand Down Expand Up @@ -68,6 +68,7 @@
"typescript": ">=3.x"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "17.3.0",
"@commitlint/config-conventional": "17.3.0",
"@fortawesome/free-solid-svg-icons": "5.13.1",
Expand Down
Loading

0 comments on commit e82a36d

Please sign in to comment.