Skip to content

Commit dea4ba5

Browse files
chore/changesets improvements (#181)
* chore: added changeset actions * chore: removed qodana old code
1 parent 09695ee commit dea4ba5

File tree

12 files changed

+125
-63
lines changed

12 files changed

+125
-63
lines changed

.changeset/config.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3-
"commit": false,
4-
"fixed": [],
5-
"linked": [],
3+
"changelog": ["@changesets/changelog-github", { "repo": "WalletConnect/web3modal-react-native" }],
64
"access": "public",
75
"baseBranch": "main",
6+
"commit": false,
87
"updateInternalDependencies": "patch",
9-
"ignore": []
8+
"ignore": ["@apps/gallery", "@apps/native", "@apps/native-cli"]
109
}

.github/workflows/changesets.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Changesets
2+
on:
3+
push:
4+
branches: [main]
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
changesets:
12+
name: Publish
13+
permissions:
14+
contents: write
15+
id-token: write
16+
pull-requests: write
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 5
19+
20+
steps:
21+
- name: Checkout Repo
22+
uses: actions/checkout@v4
23+
24+
- name:
25+
uses: ./.github/actions/setup
26+
27+
- name: Create Release Pull Request
28+
uses: changesets/action@v1
29+
with:
30+
title: 'chore: version packages'
31+
commit: 'chore: version packages'
32+
createGithubReleases: ${{ github.ref == 'refs/heads/main' }}
33+
publish: yarn run changeset:publish
34+
version: yarn run changeset:version
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
39+
- name: Publish prerelease
40+
if: steps.changesets.outputs.published != 'true'
41+
continue-on-error: true
42+
env:
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
run: |
46+
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
47+
git reset --hard origin/main
48+
yarn run clean
49+
yarn run changeset version --no-git-tag --snapshot canary
50+
yarn run changeset:prepublish
51+
yarn run changeset publish --no-git-tag --snapshot canary --tag canary

.github/workflows/ci.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/pull-request.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Pull Request
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize, ready_for_review]
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
verify:
12+
name: Verify
13+
uses: ./.github/workflows/verify.yml
14+
secrets: inherit

.github/workflows/release.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/snapshot.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Snapshot
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
snapshot:
7+
name: Release snapshot version
8+
permissions:
9+
contents: write
10+
id-token: write
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 5
13+
14+
steps:
15+
- name: Clone repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup
19+
uses: ./.github/actions/setup
20+
21+
- name: Publish Snapshots
22+
continue-on-error: true
23+
env:
24+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: |
27+
snapshot=$(git branch --show-current | tr -cs '[:alnum:]-' '-' | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
28+
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
29+
yarn run clean
30+
yarn run changeset version --no-git-tag --snapshot $snapshot
31+
yarn run changeset:prepublish
32+
yarn run changeset publish --no-git-tag --snapshot $snapshot --tag $snapshot

.github/workflows/verify.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Verify
2+
on:
3+
workflow_call:
4+
workflow_dispatch:
5+
6+
jobs:
7+
pre-publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Setup
14+
uses: ./.github/actions/setup
15+
16+
- name: Pre-Build package
17+
run: yarn run changeset:prepublish

jest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module.exports = {
22
preset: 'react-native',
33
modulePathIgnorePatterns: ['<rootDir>/node_modules', '<rootDir>/packages/*/lib/'],
4-
coverageDirectory: '.qodana/code-coverage/',
54
coverageReporters: ['lcovonly']
65
};

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
"test": "turbo run test --parallel",
2727
"clean": "turbo clean && rm -rf node_modules && watchman watch-del-all",
2828
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\" --ignore-path .gitignore",
29-
"pre-publish": "turbo clean lint prettier --parallel; yarn install; turbo run build; turbo run test;"
29+
"changeset:prepublish": "turbo clean lint prettier --parallel; yarn install; yarn version:update; turbo run build; turbo run test;",
30+
"changeset:publish": "yarn run changeset:prepublish; yarn run changeset publish",
31+
"changeset:version": "changeset version; yarn run version:update",
32+
"version:update": "./scripts/bump-version.sh"
3033
},
3134
"devDependencies": {
3235
"@changesets/changelog-github": "0.5.0",

packages/scaffold-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"module": "lib/module/index.js",
77
"source": "src/index.ts",
88
"scripts": {
9-
"build": "./scripts/bump-version.sh && bob build",
9+
"build": "bob build",
1010
"clean": "rm -rf lib",
1111
"test": "jest --passWithNoTests",
1212
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"

qodana.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/scaffold-utils/scripts/bump-version.sh renamed to scripts/bump-version.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22

3-
# Get version from package.json
4-
version=$(awk -F: '/"version":/ {print $2}' package.json | tr -d ' ",')
3+
# Get version from packages/scaffold-utils/package.json
4+
version=$(awk -F: '/"version":/ {print $2}' packages/scaffold-utils/package.json | tr -d ' ",')
55
# File where VERSION is defined
6-
file="src/utils/ConstantsUtil.ts"
6+
file="packages/scaffold-utils/src/utils/ConstantsUtil.ts"
77

88
# Use sed to replace VERSION
99
if [[ "$OSTYPE" == "darwin"* ]]; then

0 commit comments

Comments
 (0)