Skip to content

Commit

Permalink
chore: sign-off release commit and do not publish src (#1922)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <timo@animo.id>
  • Loading branch information
TimoGlastra committed Jun 25, 2024
1 parent f1cbf6f commit 0952fca
Show file tree
Hide file tree
Showing 25 changed files with 173 additions and 175 deletions.
24 changes: 24 additions & 0 deletions .changeset/commit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { execSync } = require('node:child_process')

const getSignedOffBy = () => {
const gitUserName = execSync('git config user.name').toString('utf-8').trim()
const gitEmail = execSync('git config user.email').toString('utf-8').trim()

return `Signed-off-by: ${gitUserName} <${gitEmail}>`
}

const getAddMessage = async (changeset) => {
return `docs(changeset): ${changeset.summary}\n\n${getSignedOffBy()}\n`
}

const getVersionMessage = async (releasePlan) => {
const publishableReleases = releasePlan.releases.filter((release) => release.type !== 'none')
const releasedVersion = publishableReleases[0].newVersion

return `chore(release): version ${releasedVersion}\n\n${getSignedOffBy()}\n`
}

module.exports = {
getAddMessage,
getVersionMessage,
}
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": true,
"commit": "./commit",
"privatePackages": false,
"fixed": [["@credo-ts/*"]],
"access": "public",
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
},
},
rules: {
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false, variables: true }],
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
- main
- '**-pre'

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

permissions:
pull-requests: write
contents: write
Expand Down Expand Up @@ -40,16 +38,26 @@ jobs:
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
commit: 'chore(release): new version'
title: 'chore(release): new version'
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}

- name: Get current package version
id: get_version
run: echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version")" >> $GITHUB_ENV

- name: Create Github Release
if: steps.changesets.outputs.published == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.CURRENT_PACKAGE_VERSION }}

release-unstable:
name: Release Unstable
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'chore(release): new version')"
if: "!startsWith(github.event.head_commit.message, 'chore(release): version')"
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"@types/uuid": "^9.0.1",
"@types/varint": "^6.0.0",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"bn.js": "^5.2.1",
"cors": "^2.8.5",
"eslint": "^8.36.0",
Expand All @@ -58,7 +58,6 @@
"rxjs": "^7.8.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.0.0",
"tsconfig-paths": "^4.1.2",
"tsyringe": "^4.8.0",
"typescript": "~5.5.2",
"ws": "^8.13.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/action-menu/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/action-menu",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/action-menu",
Expand Down
6 changes: 3 additions & 3 deletions packages/anoncreds/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/anoncreds",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/anoncreds",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { fetchCredentialDefinition } from '../../utils/anonCredsObjects'
import {
getIndyNamespaceFromIndyDid,
getQualifiedDidIndyDid,
getUnQualifiedDidIndyDid,
getUnqualifiedRevocationRegistryDefinitionId,
isIndyDid,
isUnqualifiedCredentialDefinitionId,
Expand Down
6 changes: 3 additions & 3 deletions packages/askar/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/askar",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/askar",
Expand Down
6 changes: 3 additions & 3 deletions packages/bbs-signatures/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/bbs-signatures",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/bbs-signatures",
Expand Down
6 changes: 3 additions & 3 deletions packages/cheqd/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/cheqd",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/cheqd",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/core",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/core",
Expand Down
6 changes: 3 additions & 3 deletions packages/drpc/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/drpc",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/drpc",
Expand Down
3 changes: 2 additions & 1 deletion packages/drpc/src/models/ValidRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ValidateBy, ValidationError, buildMessage } from 'class-validator'

export function IsValidDrpcRequest(validationOptions?: ValidationOptions): PropertyDecorator {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return function (target: any, propertyKey: string | symbol) {
return (target: any, propertyKey: string | symbol) => {
ValidateBy(
{
name: 'isValidDrpcRequest',
Expand Down Expand Up @@ -36,6 +36,7 @@ export function IsValidDrpcRequest(validationOptions?: ValidationOptions): Prope
}
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function isValidDrpcRequest(value: any): boolean {
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
return false
Expand Down
4 changes: 3 additions & 1 deletion packages/drpc/src/models/ValidResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ValidateBy, ValidationError, buildMessage } from 'class-validator'

export function IsValidDrpcResponse(validationOptions?: ValidationOptions): PropertyDecorator {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return function (target: any, propertyKey: string | symbol) {
return (target: any, propertyKey: string | symbol) => {
ValidateBy(
{
name: 'isValidDrpcResponse',
Expand Down Expand Up @@ -36,6 +36,7 @@ export function IsValidDrpcResponse(validationOptions?: ValidationOptions): Prop
}
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function isValidDrpcResponse(value: any): boolean {
// Check if value is an object
if (typeof value !== 'object' || value === null) {
Expand All @@ -62,6 +63,7 @@ export function isValidDrpcResponse(value: any): boolean {
return false
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function isValidDrpcResponseError(error: any): boolean {
return typeof error === 'object' && error !== null && 'code' in error && 'message' in error
}
6 changes: 3 additions & 3 deletions packages/indy-sdk-to-askar-migration/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/indy-sdk-to-askar-migration",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/indy-sdk-to-askar-migration",
Expand Down
6 changes: 3 additions & 3 deletions packages/indy-vdr/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/indy-vdr",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/indy-vdr",
Expand Down
6 changes: 3 additions & 3 deletions packages/node/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/node",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/node",
Expand Down
6 changes: 3 additions & 3 deletions packages/openid4vc/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/openid4vc",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/openid4vc",
Expand Down
6 changes: 3 additions & 3 deletions packages/question-answer/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/question-answer",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/question-answer",
Expand Down
6 changes: 3 additions & 3 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@credo-ts/react-native",
"main": "build/index",
"main": "src/index",
"types": "src/index",
"version": "0.5.6",
"files": [
"!src/**/__tests__",
"src",
"build"
],
"license": "Apache-2.0",
"publishConfig": {
"main": "build/index",
"types": "build/index",
"access": "public"
},
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/react-native",
Expand Down
Loading

0 comments on commit 0952fca

Please sign in to comment.