Skip to content

Commit 293444d

Browse files
authored
Merge pull request #7 from sairanjit/ci/release
ci : add changeset to release dependency
2 parents ff45443 + f4d1651 commit 293444d

File tree

9 files changed

+590
-1497
lines changed

9 files changed

+590
-1497
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/commit.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { execSync } = require('node:child_process')
2+
3+
const getSignedOffBy = () => {
4+
const gitUserName = execSync('git config user.name').toString('utf-8').trim()
5+
const gitEmail = execSync('git config user.email').toString('utf-8').trim()
6+
7+
return `Signed-off-by: ${gitUserName} <${gitEmail}>`
8+
}
9+
10+
const getAddMessage = async (changeset) => {
11+
return `docs(changeset): ${changeset.summary}\n\n${getSignedOffBy()}\n`
12+
}
13+
14+
const getVersionMessage = async () => {
15+
return `chore(release): new version\n\n${getSignedOffBy()}\n`
16+
}
17+
18+
module.exports = {
19+
getAddMessage,
20+
getVersionMessage,
21+
}

.changeset/config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": "./commit",
5+
"privatePackages": false,
6+
"fixed": [["@ayanworks/*"]],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"snapshot": {
11+
"useCalculatedVersion": true
12+
}
13+
}

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
# Cancel previous runs that are not completed yet
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
validate:
18+
runs-on: ubuntu-latest
19+
name: Validate
20+
steps:
21+
- name: Checkout credo-ethr-module
22+
uses: actions/checkout@v4
23+
24+
- name: Setup NodeJS
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
cache: 'yarn'
29+
30+
- name: Install dependencies
31+
run: yarn install --frozen-lockfile
32+
33+
- name: Linting
34+
run: yarn lint
35+
36+
- name: Prettier
37+
run: yarn check-format
38+
39+
- name: Check Types
40+
run: yarn check-types
41+
42+
- name: Compile
43+
run: yarn build

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Continuous Deployment
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release-stable:
12+
runs-on: ubuntu-latest
13+
name: Release Stable
14+
outputs:
15+
published: ${{ steps.changesets.outputs.published }}
16+
steps:
17+
- name: Checkout Repo
18+
uses: actions/checkout@v4
19+
20+
- name: Setup NodeJS
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: 'yarn'
25+
26+
- name: Install Dependencies
27+
run: yarn install --frozen-lockfile
28+
29+
- name: Create Release Pull Request or Publish to npm
30+
id: changesets
31+
uses: changesets/action@v1
32+
with:
33+
title: 'chore(release): new version'
34+
commit: 'chore(release): new version'
35+
publish: yarn release
36+
version: yarn changeset-version
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
41+
- name: Get current package version
42+
id: get_version
43+
run: echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
44+
45+
- name: Create Github Release
46+
if: steps.changesets.outputs.published == 'true'
47+
uses: softprops/action-gh-release@v2
48+
with:
49+
tag_name: v${{ env.CURRENT_PACKAGE_VERSION }}
50+
51+
release-unstable:
52+
runs-on: ubuntu-latest
53+
name: Release Unstable
54+
needs: release-stable
55+
if: always() && github.event_name == 'push' && needs.release-stable.outputs.published == 'false'
56+
steps:
57+
- name: Checkout Repo
58+
uses: actions/checkout@v4
59+
60+
- name: Setup NodeJS
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: 20
64+
cache: 'yarn'
65+
66+
- name: Install Dependencies
67+
run: yarn install --frozen-lockfile
68+
69+
- name: Creating .npmrc
70+
run: |
71+
cat << EOF > ".npmrc"
72+
//registry.npmjs.org/:_authToken=$NPM_TOKEN
73+
EOF
74+
env:
75+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
76+
77+
- name: Create unstable release
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
81+
run: |
82+
# this ensures there's always a patch release created
83+
cat << 'EOF' > .changeset/snapshot-template-changeset.md
84+
---
85+
'@ayanworks/credo-ethr-module': patch
86+
---
87+
88+
snapshot release
89+
EOF
90+
91+
yarn changeset version --snapshot alpha
92+
yarn style:fix
93+
yarn build
94+
yarn changeset publish --tag alpha
95+
96+
CURRENT_PACKAGE_VERSION=$(node -p "require('./package.json').version")
97+
git config --global user.name "Ayanworks"
98+
git config --global user.email "[email protected]"
99+
git tag v$CURRENT_PACKAGE_VERSION
100+
git push origin v$CURRENT_PACKAGE_VERSION --no-verify

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Credo did:ethereum W3C Module
1+
# Credo did:ethr Module
22

3-
- W3C did:ethereum method registry for [credo-ts](https://github.com/openwallet-foundation/credo-ts).
3+
- did:ethr method registry for [credo-ts](https://github.com/openwallet-foundation/credo-ts).
44

55
## Usage
66

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@ayanworks/credo-ethr-module",
33
"main": "build/index",
44
"types": "build/index",
5-
"version": "0.0.1-alpha",
5+
"version": "0.0.1",
66
"files": [
77
"build"
88
],
@@ -24,7 +24,9 @@
2424
"check-format": "yarn prettier --check",
2525
"prettier": "prettier --ignore-path .gitignore '**/*.+(js|json|ts|md|yml|yaml)'",
2626
"test": "jest",
27-
"lint": "eslint --ignore-path .gitignore ."
27+
"lint": "eslint --ignore-path .gitignore .",
28+
"release": "yarn build && yarn changeset publish --no-git-tag",
29+
"changeset-version": "yarn changeset version && yarn prettier --write"
2830
},
2931
"dependencies": {
3032
"@credo-ts/askar": "0.5.3",
@@ -37,6 +39,7 @@
3739
"keccak256": "^1.0.6"
3840
},
3941
"devDependencies": {
42+
"@changesets/cli": "^2.29.5",
4043
"@credo-ts/node": "0.5.3",
4144
"@hyperledger/aries-askar-nodejs": "0.2.1",
4245
"@hyperledger/aries-askar-shared": "0.2.1",
@@ -52,7 +55,6 @@
5255
"jest": "^29.5.0",
5356
"prettier": "^2.2.1",
5457
"reflect-metadata": "^0.2.1",
55-
"release-it": "^16.3.0",
5658
"rimraf": "^4.4.0",
5759
"rxjs": "^7.8.1",
5860
"ts-jest": "^29.0.5",

src/abi/SchemaRegistry.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,4 @@
173173
"stateMutability": "nonpayable",
174174
"type": "function"
175175
}
176-
]
176+
]

0 commit comments

Comments
 (0)