Skip to content

Commit

Permalink
release dev under alpha and fix windows install
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
Berend Sliedrecht committed Oct 26, 2023
1 parent e534362 commit d8ba9ae
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 61 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,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 @@ -344,24 +345,19 @@ jobs:
LIB_ARIES_ASKAR_PATH: ../../../
run: yarn test

- name: Set NPM config
if: |
github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-javascript-wrapper == '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-javascript-wrapper == '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
6 changes: 3 additions & 3 deletions wrappers/javascript/aries-askar-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/aries-askar-nodejs",
"version": "0.2.0-dev.1",
"version": "0.2.0-dev.2",
"license": "Apache-2.0",
"description": "Nodejs wrapper for Aries Askar",
"source": "src/index",
Expand Down Expand Up @@ -31,7 +31,7 @@
"example": "yarn --cwd example",
"release": "release-it",
"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": {
"@types/jest": "^27.4.1",
Expand All @@ -48,7 +48,7 @@
"dependencies": {
"@2060.io/ffi-napi": "4.0.8",
"@2060.io/ref-napi": "3.0.6",
"@hyperledger/aries-askar-shared": "0.2.0-dev.1",
"@hyperledger/aries-askar-shared": "0.2.0-dev.2",
"@mapbox/node-pre-gyp": "^1.0.10",
"node-cache": "^5.1.2",
"ref-array-di": "^1.2.2",
Expand Down
27 changes: 0 additions & 27 deletions wrappers/javascript/aries-askar-nodejs/scripts/arch.js

This file was deleted.

14 changes: 14 additions & 0 deletions wrappers/javascript/aries-askar-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)
13 changes: 0 additions & 13 deletions wrappers/javascript/aries-askar-nodejs/scripts/platform.js

This file was deleted.

4 changes: 2 additions & 2 deletions wrappers/javascript/aries-askar-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/aries-askar-react-native",
"version": "0.2.0-dev.1",
"version": "0.2.0-dev.2",
"license": "Apache-2.0",
"description": "React Native wrapper for Aries Askar",
"main": "build/index",
Expand Down Expand Up @@ -35,7 +35,7 @@
"install": "node-pre-gyp install"
},
"dependencies": {
"@hyperledger/aries-askar-shared": "0.2.0-dev.1",
"@hyperledger/aries-askar-shared": "0.2.0-dev.2",
"@mapbox/node-pre-gyp": "^1.0.10"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion wrappers/javascript/aries-askar-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/aries-askar-shared",
"version": "0.2.0-dev.1",
"version": "0.2.0-dev.2",
"license": "Apache-2.0",
"description": "Shared library for using Aries Askar with NodeJS and React Native",
"main": "build/index",
Expand Down
2 changes: 1 addition & 1 deletion wrappers/javascript/lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.2.0-dev.1",
"version": "0.2.0-dev.2",
"npmClient": "yarn",
"command": {
"version": {
Expand Down

0 comments on commit d8ba9ae

Please sign in to comment.