Skip to content
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

chore: publish to npm registry under @atala group #119

Merged
merged 5 commits into from
Nov 13, 2023
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
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: Continuous integration

concurrency:
Expand All @@ -18,16 +19,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/setup-node@v3
with:
node-version: "lts/*"
scope: "@input-output-hk"
registry-url: "https://npm.pkg.github.com"

- name: Install
run: npm install
Expand Down
30 changes: 25 additions & 5 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,50 @@ 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@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Setup Node.js for @input-output-hk
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/
scope: "@input-output-hk"

- 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/
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 atala-prism-wallet-sdk-* | 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
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +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/*"
registry-url: https://npm.pkg.github.com/
scope: "@input-output-hk"

- name: Install dependencies
run: npm install
Expand All @@ -46,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
MESSAGE: "feat(docs): ({sha}) {msg}" # The commit message
18 changes: 5 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +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_GITHUB_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/*"
registry-url: https://npm.pkg.github.com/
scope: "@input-output-hk"
registry-url: 'https://registry.npmjs.org/'

- name: Install dependencies
run: npm install
Expand All @@ -41,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 }}
Expand Down
100 changes: 48 additions & 52 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -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" },
},
]
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -20,15 +20,11 @@
"lint": "npx eslint .",
"docs": "npx typedoc --options typedoc.json --hideGenerator"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"author": "IOHK",
"repository": {
"type": "git",
"url": "https://github.com/input-output-hk/atala-prism-wallet-sdk-ts.git",
"directory": "@input-output-hk/atala-prism-wallet-sdk"
"url": "https://github.com/input-output-hk/atala-prism-wallet-sdk-ts.git"
},
"author": "IOHK",
"license": "Apache-2.0",
"peerDependenciesMeta": {
"react-native-sqlite-storage": {
Expand Down
Loading