Skip to content

Commit 944eeb8

Browse files
committed
feat(wasm-privacy-coin): add wasm privacy coin package with java wrapper
Ticket: CSHLD-1061
1 parent 0fe0da2 commit 944eeb8

24 files changed

Lines changed: 3337 additions & 1 deletion

.github/scripts/detect-changes.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { execSync } from 'child_process';
33
import { appendFileSync } from 'fs';
44

5-
const ALL_PACKAGES = ['wasm-bip32', 'wasm-mps', 'wasm-utxo', 'wasm-solana', 'wasm-dot', 'wasm-ton'];
5+
const ALL_PACKAGES = ['wasm-bip32', 'wasm-mps', 'wasm-utxo', 'wasm-solana', 'wasm-dot', 'wasm-ton', 'wasm-privacy-coin'];
66

77
function setOutput(packages) {
88
const value = JSON.stringify(packages);

.github/workflows/build-and-test.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
packages/wasm-solana
6565
packages/wasm-dot
6666
packages/wasm-ton
67+
packages/wasm-privacy-coin
6768
cache-on-failure: true
6869

6970
- name: Setup Node
@@ -101,6 +102,23 @@ jobs:
101102
- name: Build packages
102103
run: npm --workspaces run build
103104

105+
- name: Setup JDK 17 (for wasm-privacy-coin JAR)
106+
uses: actions/setup-java@v4
107+
with:
108+
distribution: corretto
109+
java-version: '17'
110+
111+
- name: Cache Maven dependencies
112+
uses: actions/cache@v4
113+
with:
114+
path: ~/.m2/repository
115+
key: ${{ runner.os }}-maven-${{ hashFiles('packages/wasm-privacy-coin/pom.xml') }}
116+
restore-keys: ${{ runner.os }}-maven-
117+
118+
- name: Build wasm-privacy-coin JAR
119+
working-directory: packages/wasm-privacy-coin
120+
run: make jar
121+
104122
- name: Check Source Code Formatting
105123
run: npm run check-fmt
106124

@@ -121,6 +139,7 @@ jobs:
121139
packages/wasm-dot/js/wasm/
122140
packages/wasm-ton/dist/
123141
packages/wasm-ton/js/wasm/
142+
packages/wasm-privacy-coin/dist/
124143
retention-days: 1
125144

126145
- name: Upload webui artifact
@@ -156,6 +175,9 @@ jobs:
156175
- package: wasm-ton
157176
needs-wasm-pack: false
158177
has-wasm-pack-tests: false
178+
- package: wasm-privacy-coin
179+
needs-wasm-pack: false
180+
has-wasm-pack-tests: false
159181
steps:
160182
- uses: actions/checkout@v4
161183
with:
@@ -203,6 +225,26 @@ jobs:
203225
run: cargo test --workspace
204226
working-directory: packages/${{ matrix.package }}
205227

228+
- name: Cache Maven dependencies
229+
if: matrix.package == 'wasm-privacy-coin'
230+
uses: actions/cache@v4
231+
with:
232+
path: ~/.m2/repository
233+
key: ${{ runner.os }}-maven-${{ hashFiles('packages/wasm-privacy-coin/pom.xml') }}
234+
restore-keys: ${{ runner.os }}-maven-
235+
236+
- name: Setup JDK 17 (wasm-privacy-coin Java tests)
237+
if: matrix.package == 'wasm-privacy-coin'
238+
uses: actions/setup-java@v4
239+
with:
240+
distribution: corretto
241+
java-version: '17'
242+
243+
- name: Java Test
244+
if: matrix.package == 'wasm-privacy-coin'
245+
working-directory: packages/wasm-privacy-coin
246+
run: make test-java
247+
206248
- name: Wasm-Pack Test (Node)
207249
if: matrix.has-wasm-pack-tests
208250
run: npm run test:wasm-pack-node
@@ -298,6 +340,15 @@ jobs:
298340
packages/wasm-ton/dist/
299341
retention-days: 1
300342

343+
- name: Upload wasm-privacy-coin build artifacts
344+
if: inputs.upload-artifacts
345+
uses: actions/upload-artifact@v4
346+
with:
347+
name: wasm-privacy-coin-build
348+
path: |
349+
packages/wasm-privacy-coin/dist/
350+
retention-days: 1
351+
301352
# This job provides a stable "test / Test" status check for branch protection.
302353
# It runs after all other jobs complete successfully.
303354
gate:

.github/workflows/publish.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,34 @@ jobs:
6060
name: wasm-ton-build
6161
path: packages/wasm-ton/
6262

63+
- name: Download wasm-privacy-coin build artifacts
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: wasm-privacy-coin-build
67+
path: packages/wasm-privacy-coin/
68+
69+
- name: Setup JDK 17
70+
uses: actions/setup-java@v4
71+
with:
72+
distribution: corretto
73+
java-version: "17"
74+
75+
- name: Configure AWS credentials
76+
uses: aws-actions/configure-aws-credentials@v4
77+
with:
78+
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
79+
aws-region: us-west-2
80+
81+
- name: Get CodeArtifact token
82+
run: |
83+
TOKEN=$(aws codeartifact get-authorization-token \
84+
--domain private \
85+
--domain-owner 199765120567 \
86+
--query authorizationToken \
87+
--output text)
88+
echo "::add-mask::$TOKEN"
89+
echo "AWS_CODEARTIFACT_TOKEN=$TOKEN" >> "$GITHUB_ENV"
90+
6391
- name: Setup Node
6492
uses: actions/setup-node@v4
6593
with:

package-lock.json

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src/main/resources/wasm/
2+
target/
3+
dist/
4+
.flattened-pom.xml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
[
6+
"@semantic-release/exec",
7+
{
8+
"publishCmd": "NEXT_VERSION=${nextRelease.version} make publish-jar"
9+
}
10+
],
11+
["@semantic-release/github", { "failComment": false }]
12+
]
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<settings
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"
4+
xmlns="http://maven.apache.org/SETTINGS/1.1.0"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
6+
<servers>
7+
<server>
8+
<id>codeartifact-central</id>
9+
<username>aws</username>
10+
<password>${env.AWS_CODEARTIFACT_TOKEN}</password>
11+
</server>
12+
</servers>
13+
</settings>

0 commit comments

Comments
 (0)