Skip to content

chore: migrate to changeset #1111

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

Merged
merged 3 commits into from
Jul 11, 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)
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "react-native-async-storage/async-storage" }
],
"commit": ["@changesets/cli/commit", { "skipCI": false }],
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to ignore eslint-config and website?

Suggested change
"ignore": []
"ignore": [
"@react-native-async-storage/eslint-config",
"async-storage-website"
]

}
32 changes: 0 additions & 32 deletions .github/workflows/default-storage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Default storage
on:
push:
branches:
- main
pull_request:
jobs:
changes:
Expand Down Expand Up @@ -140,32 +137,3 @@ jobs:
run: |
yarn react-native run-windows --release --arch x64 --logging --no-packager --no-launch --no-deploy --msbuildprops "BundleEntryFile=index.ts,UseBundle=false" --no-telemetry
working-directory: packages/default-storage

release:
name: Release
needs: [android, ios, macos, windows]
if: github.event_name == 'push'
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup project
uses: ./.github/actions/setup-project
- name: Install JS dependencies
run: |
yarn
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GH_BOT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GH_BOT_NAME }}
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
run: |
git config user.email ${{ secrets.GH_BOT_EMAIL }}
git config user.name ${{ secrets.GH_BOT_NAME }}
yarn semantic-release
working-directory: packages/default-storage
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release
on:
push:
branches: [main]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup project
uses: ./.github/actions/setup-project
- name: Install dependencies
run: yarn
- name: Setup git user
run: |
git config --global user.name ${{ secrets.GH_BOT_NAME }}
git config --global user.email ${{ secrets.GH_BOT_EMAIL }}
- name: Version or release packages
uses: changesets/action@v1
with:
title: "release: version packages"
commit: "release: version packages"
setupGitUser: false
publish: "yarn release:publish"
version: "yarn release:version"
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
"format:js": "prettier --write $(git ls-files '*.js' '*.json' '*.ts' '*.tsx' '*.yml' 'README.md')",
"test:lint": "turbo run test:lint",
"test:ts": "turbo run test:ts",
"test:format": "prettier --check --loglevel warn $(git ls-files '*.js' '*.json' '*.ts' '*.tsx' '*.yml' 'README.md')"
"test:format": "prettier --check --loglevel warn $(git ls-files '*.js' '*.json' '*.ts' '*.tsx' '*.yml' 'README.md')",
"release:version": "changeset version",
"release:publish": "changeset release"
},
"devDependencies": {
"@changesets/cli": "^2.27.7",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add @changesets/changelog-github since we're referencing it in the config?

Suggested change
"@changesets/cli": "^2.27.7",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.7",

"concurrently": "^8.2.2",
"eslint": "^8.54.0",
"prettier": "^2.8.8",
Expand Down
25 changes: 0 additions & 25 deletions packages/default-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@
"@react-native/babel-preset": "^0.73.19",
"@react-native/metro-config": "^0.73.3",
"@rnx-kit/metro-config": "^1.3.15",
"@semantic-release/changelog": "^6.0.0",
"@semantic-release/git": "^10.0.0",
"@types/lodash": "^4.14.184",
"@types/mocha": "^10.0.1",
"@types/react": "^18.0.0",
Expand All @@ -101,7 +99,6 @@
"react-native-web": "~0.18.10",
"react-native-windows": "^0.73.0",
"react-test-renderer": "18.2.0",
"semantic-release": "^19.0.0",
"typescript": "^5.3.0",
"webdriverio": "^8.24.0"
},
Expand All @@ -119,28 +116,6 @@
]
]
},
"release": {
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}
]
]
},
"codegenConfig": {
"name": "rnasyncstorage",
"type": "modules",
Expand Down
Loading
Loading