From 4b424ea8b57fa706125be42c212f20bd743ef3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20Ribo=CC=81=20Labrador?= Date: Thu, 9 Nov 2023 17:29:18 +0100 Subject: [PATCH 1/5] fix: Attempt to create and integrate new @atala npm org --- .github/workflows/ci.yml | 5 ++--- .github/workflows/e2e-tests.yml | 7 +++---- .github/workflows/release-docs.yml | 3 +-- .github/workflows/release.yml | 5 ++--- package.json | 10 +--------- 5 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49e4730cf..b2a558083 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,11 @@ jobs: - name: Setup Node.js env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.ATALA_NPM_TOKEN }} uses: actions/setup-node@v3 with: node-version: "lts/*" - scope: "@input-output-hk" - registry-url: "https://npm.pkg.github.com" + scope: "@atala" - name: Install run: npm install diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index d5a6bbb0e..7d1365a43 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -45,14 +45,13 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 - - name: Setup Node.js for @input-output-hk + - name: Setup Node.js for @atala env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.ATALA_NPM_TOKEN }} uses: actions/setup-node@v3 with: node-version: "lts/*" - registry-url: https://npm.pkg.github.com/ - scope: "@input-output-hk" + scope: "@atala" - name: Setup Node.js for @hyperledger-labs env: diff --git a/.github/workflows/release-docs.yml b/.github/workflows/release-docs.yml index d7e2987e2..13fb14ef6 100644 --- a/.github/workflows/release-docs.yml +++ b/.github/workflows/release-docs.yml @@ -27,8 +27,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: "lts/*" - registry-url: https://npm.pkg.github.com/ - scope: "@input-output-hk" + scope: "@atala" - name: Install dependencies run: npm install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b1dde7fe..2f4649f98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - NODE_AUTH_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.ATALA_NPM_TOKEN }} runs-on: ubuntu-latest steps: @@ -23,8 +23,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: "lts/*" - registry-url: https://npm.pkg.github.com/ - scope: "@input-output-hk" + scope: "@atala" - name: Install dependencies run: npm install diff --git a/package.json b/package.json index 9cc43f14a..6e26815eb 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@input-output-hk/atala-prism-wallet-sdk", + "name": "@atala/prism-wallet-sdk", "version": "3.0.0", "description": "PRISM typescript SDK", "main": "build/node/index.js", @@ -20,14 +20,6 @@ "lint": "npx eslint .", "docs": "npx typedoc --options typedoc.json --hideGenerator" }, - "publishConfig": { - "registry": "https://npm.pkg.github.com/" - }, - "repository": { - "type": "git", - "url": "https://github.com/input-output-hk/atala-prism-wallet-sdk-ts.git", - "directory": "@input-output-hk/atala-prism-wallet-sdk" - }, "author": "IOHK", "license": "Apache-2.0", "peerDependenciesMeta": { From d29f9ca332d82253a41e305a5e1f77f5604f40cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20Ribo=CC=81=20Labrador?= Date: Fri, 10 Nov 2023 13:17:17 +0100 Subject: [PATCH 2/5] fix: upgrade axios --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ccc43c56a..6458b30d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@input-output-hk/atala-prism-wallet-sdk", + "name": "@atala/prism-wallet-sdk", "version": "3.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@input-output-hk/atala-prism-wallet-sdk", + "name": "@atala/prism-wallet-sdk", "version": "3.0.0", "license": "Apache-2.0", "dependencies": { From 95d0e4722c86c11a6e0f1dee80f7d813a0e75bcf Mon Sep 17 00:00:00 2001 From: Allain Magyar Date: Fri, 10 Nov 2023 15:44:41 -0300 Subject: [PATCH 3/5] ci: updates to new atala org --- .github/workflows/ci.yml | 6 +- .github/workflows/e2e-tests.yml | 9 +-- .github/workflows/release-docs.yml | 8 +-- .github/workflows/release.yml | 17 ++--- .releaserc.yml | 100 ++++++++++++++--------------- package.json | 4 ++ 6 files changed, 64 insertions(+), 80 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2a558083..ee59a257e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,4 @@ + name: Continuous integration concurrency: @@ -18,15 +19,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - env: - NODE_AUTH_TOKEN: ${{ secrets.ATALA_NPM_TOKEN }} uses: actions/setup-node@v3 with: node-version: "lts/*" - scope: "@atala" - name: Install run: npm install diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 7d1365a43..50318b70e 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -40,23 +40,20 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 - name: Setup Node.js for @atala - env: - NODE_AUTH_TOKEN: ${{ secrets.ATALA_NPM_TOKEN }} uses: actions/setup-node@v3 with: node-version: "lts/*" - scope: "@atala" - name: Setup Node.js for @hyperledger-labs - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} uses: actions/setup-node@v3 + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: node-version: "lts/*" registry-url: https://npm.pkg.github.com/ diff --git a/.github/workflows/release-docs.yml b/.github/workflows/release-docs.yml index 13fb14ef6..49c319cde 100644 --- a/.github/workflows/release-docs.yml +++ b/.github/workflows/release-docs.yml @@ -15,19 +15,15 @@ jobs: docs: name: build documentation and release runs-on: ubuntu-latest - env: - GITHUB_ACTOR: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: "lts/*" - scope: "@atala" - name: Install dependencies run: npm install @@ -45,4 +41,4 @@ jobs: BRANCH: gh-pages # The branch name where you want to push the assets FOLDER: docs # The directory where your assets are generated GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub will automatically add this - you don't need to bother getting a token - MESSAGE: "feat(docs): ({sha}) {msg}" # The commit message \ No newline at end of file + MESSAGE: "feat(docs): ({sha}) {msg}" # The commit message diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f4649f98..443d0bb65 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,25 +5,16 @@ on: jobs: release: - env: - GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }} - GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} - ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }} - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - NODE_AUTH_TOKEN: ${{ secrets.ATALA_NPM_TOKEN }} - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.ATALA_GITHUB_TOKEN }} - fetch-depth: 0 + - name: Checkout Code + uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: "lts/*" - scope: "@atala" + registry-url: 'https://registry.npmjs.org/' - name: Install dependencies run: npm install @@ -40,6 +31,8 @@ jobs: - name: Release env: + NODE_AUTH_TOKEN: ${{ secrets.ATALA_NPM_TOKEN }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} GIT_AUTHOR_EMAIL: ${{ steps.import_gpg.outputs.email }} GIT_COMMITTER_EMAIL: ${{ steps.import_gpg.outputs.email }} GIT_AUTHOR_NAME: ${{ steps.import_gpg.outputs.name }} diff --git a/.releaserc.yml b/.releaserc.yml index 90433edf1..69eeea6c6 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -1,55 +1,51 @@ branches: - - 'master' + - "master" plugins: - - '@semantic-release/commit-analyzer' - - '@semantic-release/release-notes-generator' - - [ '@semantic-release/changelog', - { - changelogFile: 'CHANGELOG.md' - } - ] - - [ '@semantic-release/exec', - { - prepareCmd: 'npm version ${nextRelease.version} --git-tag-version false' - } - ] - - [ '@semantic-release/exec', - { - prepareCmd: 'npm publish' - } - ] - - [ '@semantic-release/exec', - { - prepareCmd: 'yarn --cwd integration-tests/e2e-tests add @input-output-hk/atala-prism-wallet-sdk@^${nextRelease.version}' - } - ] - - [ '@semantic-release/git', - { - assets: [ - 'package.json', - 'package-lock.json', - 'CHANGELOG.md', - 'integration-tests/e2e-tests/package.json', - 'integration-tests/e2e-tests/yarn.lock' - ], - message: 'chore(release): release ${nextRelease.version} - - ${nextRelease.notes}' - } - ] - - [ "semantic-release-slack-bot", - { - notifyOnSuccess: true, - notifyOnFail: true, - markdownReleaseNotes: true, - onSuccessTemplate: { - text: "A new version of `$package_name` successfully released!\n - Version: `$npm_package_version`\n - Tag: $repo_url/releases/tag/v$npm_package_version\n - \n - Release notes:\n - $release_notes" - } - } - ] + - "@semantic-release/commit-analyzer" + - "@semantic-release/release-notes-generator" + - ["@semantic-release/changelog", { changelogFile: "CHANGELOG.md" }] + - [ + "@semantic-release/exec", + { + prepareCmd: "npm version ${nextRelease.version} --git-tag-version false", + }, + ] + - ["@semantic-release/exec", { prepareCmd: "npm publish --access public" }] + - [ + "@semantic-release/exec", + { + prepareCmd: "yarn --cwd integration-tests/e2e-tests add @atala/prism-wallet-sdk@^${nextRelease.version}", + }, + ] + - [ + "@semantic-release/git", + { + assets: + [ + "package.json", + "package-lock.json", + "CHANGELOG.md", + "integration-tests/e2e-tests/package.json", + "integration-tests/e2e-tests/yarn.lock", + ], + message: "chore(release): release ${nextRelease.version} + + ${nextRelease.notes}", + }, + ] + - [ + "semantic-release-slack-bot", + { + notifyOnSuccess: true, + notifyOnFail: true, + markdownReleaseNotes: true, + onSuccessTemplate: + { text: "A new version of `$package_name` successfully released!\n + Version: `$npm_package_version`\n + Tag: $repo_url/releases/tag/v$npm_package_version\n + \n + Release notes:\n + $release_notes" }, + }, + ] diff --git a/package.json b/package.json index 6e26815eb..72dd894cd 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,10 @@ "docs": "npx typedoc --options typedoc.json --hideGenerator" }, "author": "IOHK", + "repository": { + "type": "git", + "url": "https://github.com/input-output-hk/atala-prism-wallet-sdk-ts.git" + }, "license": "Apache-2.0", "peerDependenciesMeta": { "react-native-sqlite-storage": { From 4bb3f1da68899047ce553859b35cb5bd87f4815c Mon Sep 17 00:00:00 2001 From: Allain Magyar Date: Fri, 10 Nov 2023 15:53:15 -0300 Subject: [PATCH 4/5] fix: e2e --- .github/workflows/e2e-tests.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 50318b70e..d520df1ac 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -39,16 +39,25 @@ jobs: runs-on: ubuntu-latest steps: + - name: Mask apikey + env: + APIKEY: ${{ inputs.apiKey || secrets.APIKEY }} + run: echo "::add-mask::${{env.APIKEY}}" + - name: Checkout Code uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 - - name: Setup Node.js for @atala + - name: Setup Node.js for @input-output-hk uses: actions/setup-node@v3 + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: node-version: "lts/*" + registry-url: https://npm.pkg.github.com/ + scope: "@input-output-hk" - name: Setup Node.js for @hyperledger-labs uses: actions/setup-node@v3 @@ -59,6 +68,21 @@ jobs: registry-url: https://npm.pkg.github.com/ scope: "@hyperledger-labs" + - name: Pack atala-prism-wallet-sdk + if: github.event_name == 'pull_request' + run: | + npm install + npm run build + npm pack + echo "PACKAGE_NAME=$(find . -maxdepth 1 -name input-output* | tr -d '\n')" >> "$GITHUB_ENV" + + - name: Install local dependency + if: github.event_name == 'pull_request' + working-directory: integration-tests/e2e-tests + run: | + yarn + yarn add "../../${{ env.PACKAGE_NAME }}" + - name: Install dependencies working-directory: integration-tests/e2e-tests run: yarn From 4c027fd1d8e56425c3d857496ebbfdf70cd77a45 Mon Sep 17 00:00:00 2001 From: Allain Magyar Date: Fri, 10 Nov 2023 15:55:39 -0300 Subject: [PATCH 5/5] ci: update package finding --- .github/workflows/e2e-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index d520df1ac..2965bd95e 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -74,7 +74,7 @@ jobs: npm install npm run build npm pack - echo "PACKAGE_NAME=$(find . -maxdepth 1 -name input-output* | tr -d '\n')" >> "$GITHUB_ENV" + echo "PACKAGE_NAME=$(find . -maxdepth 1 -name atala-prism-wallet-sdk-* | tr -d '\n')" >> "$GITHUB_ENV" - name: Install local dependency if: github.event_name == 'pull_request'