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: replace release-it with Changesets #241

Merged
merged 1 commit into from
Aug 13, 2024
Merged
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)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@changesets/changelog-github",
{ "repo": "tien/react-airplay" }
],
"privatePackages": false
}
5 changes: 5 additions & 0 deletions .changeset/nice-balloons-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-airplay": patch
---

Placeholder.
22 changes: 22 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Setup

description: Checkout repository & install dependencies

runs:
using: composite
steps:
- uses: volta-cli/action@v4
- run: yarn install --immutable
shell: bash

- uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- run: bundle exec pod install
working-directory: ios
shell: bash

- run: bundle exec pod install
working-directory: example/ios
shell: bash
28 changes: 28 additions & 0 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publishing

on:
push:
branches: [main]

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
publish:
runs-on: macos-latest

permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- uses: changesets/action@v1
with:
publish: yarn publish:packages
commit: "chore: version packages"
title: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pull request

on:
pull_request:
branches: [main]
# Add trigger for `ready_for_review`
# https://github.com/changesets/action/issues/187
types: [opened, reopened, synchronize, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
uses: ./.github/workflows/verification.yml
47 changes: 0 additions & 47 deletions .github/workflows/release.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/validation.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Verification

on: [workflow_call, workflow_dispatch]

jobs:
verify:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: yarn typescript
- run: yarn lint
- run: yarn build
17 changes: 0 additions & 17 deletions .release-it.json

This file was deleted.

10 changes: 0 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@ We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint]

Our pre-commit hooks verify that the linter and tests pass when committing.

### Publishing to npm

We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.

To publish new versions, run the following:

```sh
yarn release
```

### Scripts

The `package.json` file contains various scripts for common tasks:
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"yarn": "4.4.0"
},
"workspaces": [
".",
"example"
],
"source": "./src/index.ts",
Expand Down Expand Up @@ -52,7 +53,7 @@
"typescript": "tsc --noEmit",
"lint": "eslint \"**/*.{js,ts,tsx}\" && cd ios && Pods/SwiftLint/swiftlint --strict",
"prepack": "yarn build",
"release": "release-it"
"publish:packages": "yarn build && yarn workspaces foreach -Apt --no-private npm publish --access public --tolerate-republish && yarn changeset tag"
},
"keywords": [
"react-native",
Expand All @@ -74,11 +75,12 @@
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.7",
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@react-native-community/eslint-config": "^3.2.0",
"@react-native/eslint-config": "^0.74.87",
"@release-it/conventional-changelog": "^8.0.1",
"@types/jest": "^29.5.12",
"@types/react": "^18.3.3",
"@types/react-native": "0.73.0",
Expand All @@ -92,7 +94,6 @@
"react": "18.3.1",
"react-native": "0.74.5",
"react-native-builder-bob": "^0.29.1",
"release-it": "^17.6.0",
"typescript": "^5.5.4"
},
"peerDependencies": {
Expand Down
Loading