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

release dev under alpha and fix windows install #230

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
23 changes: 9 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: "https://registry.npmjs.org/"

- name: Fetch library artifacts
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -272,24 +273,18 @@ jobs:
LIB_INDY_VDR_PATH: ../../../
run: yarn test

- name: Set NPM config
if: |
github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-wrappers == 'true')
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "always-auth=true" >> .npmrc

# TODO: this will currently publish the version as defined in the package.json. If the version already
# exists on NPM it will skip the publishing. This means if a new version is released, but the version hasn't been
# updated in the package.json files yet, it won't publish to NPM (which is kinda nice). We should however add a check
# to see if the JS version matches the release version (do we want to keep the js and rust version in sync?)
- name: Publish
if: |
github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-wrappers == 'true')
run: npx lerna publish from-package --no-push --no-private --yes --no-git-tag-version
run: |
if [[ $(cat lerna.json | grep version | head -1 | grep dev) ]]; then
npx lerna publish from-package --no-push --no-private --yes --no-git-tag-version --dist-tag=alpha
else
npx lerna publish from-package --no-push --no-private --yes --no-git-tag-version
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

build-ios:
name: Build library (iOS)
Expand Down
3 changes: 2 additions & 1 deletion wrappers/javascript/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ module.exports = {
},
overrides: [
{
files: ['arch.js', 'platform.js'],
files: ['**/scripts/*.js'],
env: {
node: true,
},
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'no-console': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
},
},
{
Expand Down
6 changes: 3 additions & 3 deletions wrappers/javascript/indy-vdr-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/indy-vdr-nodejs",
"version": "0.2.0-dev.2",
"version": "0.2.0-dev.3",
"license": "Apache-2.0",
"description": "Nodejs wrapper for Indy Vdr",
"source": "src/index",
Expand All @@ -24,7 +24,7 @@
"clean": "rimraf -rf ./build",
"compile": "tsc -p tsconfig.build.json",
"test": "jest",
"install": "node-pre-gyp install --target_arch=$(node scripts/arch.js) --target_platform=$(node scripts/platform.js)"
"install": "node scripts/install.js"
},
"devDependencies": {
"@babel/core": "^7.12.9",
Expand All @@ -40,7 +40,7 @@
"typescript": "~4.9.4"
},
"dependencies": {
"@hyperledger/indy-vdr-shared": "0.2.0-dev.2",
"@hyperledger/indy-vdr-shared": "0.2.0-dev.3",
"@mapbox/node-pre-gyp": "^1.0.10",
"@2060.io/ffi-napi": "4.0.8",
"@2060.io/ref-napi": "3.0.6",
Expand Down
23 changes: 0 additions & 23 deletions wrappers/javascript/indy-vdr-nodejs/scripts/arch.js

This file was deleted.

14 changes: 14 additions & 0 deletions wrappers/javascript/indy-vdr-nodejs/scripts/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { execSync } = require('node:child_process')
const { arch, platform } = require('os')

const archTable = {
x64: 'x86_64',
arm64: 'aarch64',
}

const targetPlatform = platform() === 'win32' ? 'windows' : platform()
const targetArchitecture = archTable[arch()]

const command = `node-pre-gyp install --target_arch=${targetArchitecture} --target_platform=${targetPlatform}`

execSync(command)
9 changes: 0 additions & 9 deletions wrappers/javascript/indy-vdr-nodejs/scripts/platform.js

This file was deleted.

4 changes: 2 additions & 2 deletions wrappers/javascript/indy-vdr-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/indy-vdr-react-native",
"version": "0.2.0-dev.2",
"version": "0.2.0-dev.3",
"license": "Apache-2.0",
"description": "React Native wrapper for Indy Vdr",
"source": "src/index",
Expand Down Expand Up @@ -40,7 +40,7 @@
"install": "node-pre-gyp install"
},
"dependencies": {
"@hyperledger/indy-vdr-shared": "0.2.0-dev.2",
"@hyperledger/indy-vdr-shared": "0.2.0-dev.3",
"@mapbox/node-pre-gyp": "^1.0.10"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion wrappers/javascript/indy-vdr-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/indy-vdr-shared",
"version": "0.2.0-dev.2",
"version": "0.2.0-dev.3",
"license": "Apache-2.0",
"description": "Shared library for using Indy VDR with NodeJS and React Native",
"main": "build/index",
Expand Down
6 changes: 3 additions & 3 deletions wrappers/javascript/lerna.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"packages": ["indy-vdr-*"],
"version": "0.2.0-dev.2",
"version": "0.2.0-dev.3",
"npmClient": "yarn",
"command": {
"version": {
"allowBranch": "main"
}
},
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
}