Skip to content

Commit

Permalink
Merge branch 'release/v1.1.23'
Browse files Browse the repository at this point in the history
  • Loading branch information
farbanas committed Jul 5, 2023
2 parents da9c2e5 + bdda08c commit c3ce9e2
Show file tree
Hide file tree
Showing 16 changed files with 136 additions and 33 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build-ts-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ jobs:
node-version: 18
- name: Setup yarn
run: npm install -g yarn
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build
run: yarn && yarn build && yarn build:ci
- name: Deploy branch to CI www (storybook)
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/nym-connect-publish-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Node v16
- name: Node
uses: actions/setup-node@v3
with:
node-version: 18
Expand Down Expand Up @@ -51,11 +51,15 @@ jobs:
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Create env file
uses: timheuer/base64-to-file@v1.1
uses: timheuer/base64-to-file@v1.2
with:
fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}

- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000

- name: Install app dependencies and build it
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -73,7 +77,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: nym-connect_1.0.0_x64.dmg
path: nym-connect/desktop/target/release/bundle/dmg/nym-connect_1.0.0_x64.dmg
path: nym-connect/desktop/target/release/bundle/dmg/nym-connect_1*_x64.dmg
retention-days: 30

- name: Clean up keychain
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/nym-connect-publish-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
continue-on-error: true

- name: Node v16
- name: Node
uses: actions/setup-node@v3
with:
node-version: 18
Expand All @@ -35,10 +35,16 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000

- name: Install app dependencies
run: yarn

- name: Create env file
uses: timheuer/base64-to-file@v1.1
uses: timheuer/base64-to-file@v1.2
with:
fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
Expand All @@ -53,7 +59,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: nym-connect.AppImage.tar.gz
path: nym-connect/desktop/target/release/bundle/appimage/nym-connect_1.0.0_amd64.AppImage
path: nym-connect/desktop/target/release/bundle/appimage/nym-connect_1*_amd64.AppImage
retention-days: 30

- name: Upload to release based on tag name
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/nym-connect-publish-windows10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
Remove-Item -path certificate -include tempCert.txt
Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText)
- name: Node v16
- name: Node
uses: actions/setup-node@v3
with:
node-version: 18
Expand All @@ -50,15 +50,21 @@ jobs:
toolchain: stable

- name: Create env file
uses: timheuer/base64-to-file@v1.1
uses: timheuer/base64-to-file@v1.2
with:
fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}

- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000

- name: Install app dependencies
shell: bash
run: yarn --network-timeout 100000

- name: Build and sign it
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.WINDOWS_CERTIFICATE }}
Expand All @@ -72,7 +78,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: nym-connect_1.0.0_x64_en-US.msi
path: nym-connect/desktop/target/release/bundle/msi/nym-connect_1.0.0_x64_en-US.msi
path: nym-connect/desktop/target/release/bundle/msi/nym-connect_1*_x64_en-US.msi
retention-days: 30

- name: Upload to release based on tag name
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/nym-wallet-publish-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Node v16
- name: Node
uses: actions/setup-node@v3
with:
node-version: 18
Expand Down Expand Up @@ -51,11 +51,15 @@ jobs:
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Create env file
uses: timheuer/base64-to-file@v1.1
uses: timheuer/base64-to-file@v1.2
with:
fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}

- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000

- name: Install app dependencies and build it
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/nym-wallet-publish-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Publish Nym Wallet (Ubuntu)
on:
workflow_dispatch:
release:
types: [created]

Expand All @@ -25,7 +26,7 @@ jobs:
sudo apt-get install -y webkit2gtk-4.0
continue-on-error: true

- name: Node v16
- name: Node
uses: actions/setup-node@v3
with:
node-version: 18
Expand All @@ -34,10 +35,15 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000

- name: Install app dependencies
run: yarn
- name: Create env file
uses: timheuer/base64-to-file@v1.1
uses: timheuer/base64-to-file@v1.2
with:
fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
Expand All @@ -47,8 +53,17 @@ jobs:
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: nym-wallet_1.0.0_amd64.AppImage.tar.gz
path: nym-wallet/target/release/bundle/appimage/nym-wallet*.AppImage.tar.gz
retention-days: 30

- name: Upload to release based on tag name
uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: |
nym-wallet/target/release/bundle/appimage/*.AppImage
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/nym-wallet-publish-windows10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
Remove-Item -path certificate -include tempCert.txt
Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText)
- name: Node v16
- name: Node
uses: actions/setup-node@v3
with:
node-version: 18
Expand All @@ -50,15 +50,21 @@ jobs:
toolchain: stable

- name: Create env file
uses: timheuer/base64-to-file@v1.1
uses: timheuer/base64-to-file@v1.2
with:
fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}

- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000

- name: Install app dependencies
shell: bash
run: yarn --network-timeout 100000

- name: Build and sign it
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.WINDOWS_CERTIFICATE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nym_wallet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
profile: minimal
toolchain: stable

- name: Node v16
- name: Node
uses: actions/setup-node@v3
with:
node-version: 18
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/sdk-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish SDK to NPM
on:
workflow_dispatch:

jobs:
publish:
runs-on: [custom-runner-linux]
steps:
- uses: actions/checkout@v2

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Setup yarn
run: npm install -g yarn

- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Install dependencies
run: yarn

- name: Build and publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
working-directory: ./sdk/typescript/packages/sdk
run: scripts/publish.sh
6 changes: 0 additions & 6 deletions .github/workflows/typescript-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ jobs:
node-version: 18
- name: Setup yarn
run: npm install -g yarn
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install
run: yarn
- name: Build packages
Expand Down
2 changes: 1 addition & 1 deletion nym-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@nymproject/mui-theme": "^1.0.0",
"@nymproject/react": "^1.0.0",
"@nymproject/types": "^1.0.0",
"@nymproject/sdk": "1",
"@nymproject/sdk": "^1.1.8",
"@storybook/react": "^6.5.15",
"@tauri-apps/api": "^1.2.0",
"@tauri-apps/tauri-forage": "^1.0.0-beta.2",
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"clean": "lerna run clean",
"build": "run-s build:types build:packages",
"build:types": "lerna run --scope @nymproject/types build --stream",
"build:packages": "run-s build:packages:theme build:packages:react build:packages:sdk",
"build:packages:sdk": "lerna run --scope @nymproject/sdk build:lint",
"build:packages": "run-s build:packages:theme build:packages:react",
"build:packages:theme": "lerna run --scope @nymproject/mui-theme build",
"build:packages:react": "lerna run --scope @nymproject/react build",
"build:react-example": "lerna run --scope @nymproject/react-webpack-with-theme-example build --stream",
Expand Down
13 changes: 13 additions & 0 deletions sdk/typescript/packages/sdk/DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ The output bundle will be created in the `dist` directory.

If you're a Nym platform developer who's made changes to the Rust (or JS) files and wants to re-publish the package to NPM, here's how you do it:

Make sure you have logged into the NPM registry (`npm login`).

### Scripted

1. bump version numbers as necessary for SemVer
2. make sure you're in the SDK directory (`cd sdk/typescript/packages/sdk`)
3. run `scripts/publish.sh`

### Manually

1. bump version numbers as necessary for SemVer
2. `yarn build` builds the release directory in the root of the repo in `dist/sdk`
3. `cd ../../../../dist/sdk`
Expand All @@ -45,3 +55,6 @@ Publish the CJS package:
Publish the ESM package:
- `cd ../esm`
- `npm publish --access=public` will publish your changed package to NPM

4. bump the minor version and add `-rc0` to avoid local packages from using the workspace SDK, e.g. (`1.1.10` -> `1.1.11-rc0`)
5. commit the updated `package.json` to git
4 changes: 2 additions & 2 deletions sdk/typescript/packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nymproject/sdk",
"version": "1.1.7",
"version": "1.1.9-rc0",
"license": "Apache-2.0",
"author": "Nym Technologies SA",
"type": "module",
Expand All @@ -27,7 +27,7 @@
"prebuild:dev": "yarn build:dependencies",
"build:dev": "yarn build:dev:only-this",
"build:dev:only-this": "scripts/build.sh",
"build:lint": "run-s build:dependencies:nym-client-wasm build:dev:only-this"
"build:local": "run-s build:dependencies:nym-client-wasm build:dev:only-this"
},
"dependencies": {
"@npmcli/node-gyp": "^3.0.0",
Expand Down
22 changes: 22 additions & 0 deletions sdk/typescript/packages/sdk/scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

rm -rf dist || true
rm -rf ../../../../dist || true

yarn
yarn build
cd ../../../../dist/sdk

cd cjs
echo "Publishing CommonJS package to NPM.."
npm publish --access=public
cd ..

cd esm
echo "Publishing ESM package to NPM.."
npm publish --access=public
cd ..
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2838,6 +2838,11 @@
"@cosmjs/stargate" "^0.25.5"
axios "^0.21.1"

"@nymproject/sdk@^1.1.8":
version "1.1.8"
resolved "https://registry.yarnpkg.com/@nymproject/sdk/-/sdk-1.1.8.tgz#384ee824971dee413755b14634c3d60fb22eff9a"
integrity sha512-nAyem2wqTfc6l9e6Y7JR2V1teDfwjxMHpRjxg90FMkUWl/JP7Ww752gDsSq3nvObLt+cvxjWMHy1mswvwQfZyQ==

"@octokit/auth-token@^3.0.0":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.4.tgz#70e941ba742bdd2b49bdb7393e821dea8520a3db"
Expand Down

0 comments on commit c3ce9e2

Please sign in to comment.